1.) How do you find what files are in a directory
2. How do you hide a file
3. How do you find how much space is left on a disk
4. How do you find out how much space you are using
5. How do you find out how big a file is?
6. What does drwxr-xr-x mean?
7. What’s a group in unix?
8. What are the three sets of permisions in unix?
9. what does chmod 700 x.x command do?
10. what does chown do?
11. what does chgrp do?
12. where can you find out what groups there are on your machine?
13. where can you find out who has an account on your machine?
14. why can’t you (easily) read the /etc/shadow file?
15. what happens when you log into unix?
16. How do you find out what commands you’ve already used?
17. what’s a kernel?
18. what’s a shell?
19. How do you set passwords
20. How do you see hidden files
21. How do you find a file when you don’t know where it is
22. How do you find lines in a file that do not contain the string abc
23. How do you find what day it is
24. How do you change directory
25. What’s in the \etc directory
26. How are the directories arranged in Unix
These are all Unix Questions!
1.) How do you find what files are in a directory
Answer: ls -lh
2. How do you hide a file
Answer: mv <file_name> .<file_name>
3. How do you find how much space is left on a disk
Answer: df -h
4. How do you find out how much space you are using
Answer: du -h
NOTE: As per Chegg policy, I am allowed to answer only 4 questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.
1.) How do you find what files are in a directory 2. How do you hide...
do numbers 4-8
4. Given any directory, use the Is command to display: • all files and sub-directories starting with the letter "D" (note do not list anything in any sub-directory) • its immediate sub-directories (sub-directories only, and no other ordinary files) its immediate hidden sub-directories only - take a screenshot (#3-3) that clearly shows the command and the result. 5. Assume that the following files are in the working directory: $ ls intro notesb ref2 section 1 section3 section4b...
Objective: Practice common UNIX commands. Procedure: The following list of Unix commands are given for self-learning. Use 'whatis' or 'man' command to find out about each command. Your document should include the description or screen shots of the output from each of the command. Commands: df du gzip file history wget Changing access rights: chmod u+x Dir1.0 adds execute permission for the owner chmod go-w file1 removes write permission for the group and others chmod ugo=rw testfile sets...
What program do you use to list the files in a directory? Which option do you use to display: All files, including dotfiles (hidden files) Names in reverse alphabetical order Entire tree, including all subdirectories Flags after each name (/ = directory) Size of each file, in human readable units Long listings (permissions, owner, and so on) Information about a directory itself, not its contents When you look at a directory listing, what do the entries . and .. mean?
a) How would you use the ls command to display all of the files/directories in the directory ‘/sbin’ that start with ‘bl’? b) How would you use the ls command to display all of the files/directories in your current directory that contain the word ‘grade’ somewhere in the name and end with ‘.pdf’? c) How would you use the ls command to display all of the files/directories in your current directory that are any two characters followed by the file...
LUNIX (Please Label) Exit vi (:q) and from the command line, type viscript4.sh. For this script, we will iterate through all files in the current directory print out their name using the for loop. Example (do not type yet): foriin*;do …;done where the…does some operation on$I, which stands for the current file. To do this, enter the following in your script4.sh file: #!/bin/bash for i in *; do echo $i done Once the above works, change the for loop to...
QUESTION 1 What will be the output of following Unix command: find / -name ‘*’ A. List all files and directories recursively starting from / B. List a file names * in / C. List all files in / directory D. List all files and directories in / directory QUESTION 2 Which command is used to extract a column/field from a text file / input. A. paste B. get C. cut D. tar QUESTION 3 Which command creates an empty...
Write a bash shell script, deleteFilesWithZeroLength.sh, that removes all zero length ordinary files in the directory passed as an optional argument. If you do not specify the directory argument, the script uses the present working directory as the default argument. Do appropriate exception handling in your script such as:If the arguments are more than 1, print out “Too many arguments passed”.If the argument passed is a regular file, print out “XXX is regular file”.1c. If the directory doesn’t exist, print out “Directory...
Directories in /sys/class (what doesn't belong) contain symbolic links list devices defined by different subsystems of the kernel are mostly created by kernel modules take up disk space In the Linux kernel processes are represented as a process_struct task_struct thread_struct program_struct getdents returns multiple directory entries per call because Switching from user space to kernel space is expensive Switching from kernel space to user space is expensive A directory block on disk will generally hold multiple entries All of the...
Step 3: How would you write this script in C? It needs to do the
things required in step 3.
1. You have received a new batch of distinguished users; their basic information is located in newusers.tar. Inside of the tar file, there is a file called "newusers.txt" which contains a colon-separated entry for each user: the username, the uid, the GECOS information, and the user's preferred shell. Also in the tar file you will find a public key for...
COSC 3411 /ITAP 3411 Homework (UNIX Shell Commands) How would you ensure that all ordinary files created by you have rw-rw---- as default permissions? How would you sort in the background a file called "bad.txt", and place the results in a file called "sort.txt"? Archive the contents of your home directory (including any subdirectories) using tar. Compress the tar archive with gzip. Now extract their contents. Use the “find” command to locate in /docs and /usr/docs all files that Begin...