Part 3 - Exploring the system Flashcards
Explored files, directories and their contents. Learned about how open this system is.
What does the command file do?
Determine file type
What does the command less do?
View file contents
What is the difference between ls, ls /usr and ls ~ /usr ?
ls lists the files and directories in your current directory, ls /usr list the the content in usr directory ( you don’t have to be in it) and ls ~ /usr sends two arguments to ls one to show your user directory and your home directory at the same time!
What is the structure of a command?
command -options arguments
What does the command ls -lt do?
Ls lists contents and l option means long format and t option sorts the result by the file’s modification time.
What happens if you add ls -lt —reverse?
–reverse is a long option that reverses the order of the sort.
Explain this long format view ‘-rw-r–r– 1 root root 4378932 2024-04-03 11:05 Text.odt’
‘-rw-r–r–’ access right to the file. 1st character indicates type of file. Leading dash means reg file and d means directory. ‘1’ file number of hard links. ‘root’ the username of the file’s owner. ‘root’ the name of the group which owns the file. ‘4378932’ size of file in bytes. ‘2024-04-04 11:05’ date and time of last modification ‘ Text.odt’ name of the file.
What is a common idea in any Unix based operating system?
’ everything is file’
What is ASCII text?
American Standard Code for Information Interchange. Text is a simple one to one mapping of characters to numbers. 50 characters of text translates to 50 bytes of data.
Why would we want to examine text files?
Because many of the files that contain system settings ( config files) are stored in this format.
In less how do you scroll back a page?
Page up or b
In less how do you scroll forward 1 page?
Page Down or space
How do you move to the end of a text file?
G
How do you move to the beginning of a text file?
1G or g
What does / mean?
root directory