Linux Chapter 1 Flashcards
(17 cards)
$ vs # on bash
means root
Command quiz : df
Current amount of free space on our disk drive
Command quiz : free
Current amount of free memory
Command quiz : pwd
Print Working Directory
Do file extensions matter on Linux?
Nope. Contents and purpose of files are determined through other means.
Command quiz: cd with no arguments
Changes the working directory to your home directory.
Command quiz: cd ~user_name
Changes the working directory to the home directory of user_name. For example, typing cd ~bob will change the directory to the home directory of user “bob.
List contents of multiple directories
ls ~ /etc
Command quiz: ls -l
List files, but with more details (long)
What is the general format of commands?
command -option arguments.
Multiple options can be strung together. There are “long options” as well, which are options preceded by two dashes instead of one. Some short options have a long option version. For example, “ls -a” is the same as ls “–all”.
Command quiz: ls -dl
Ordinarily, if a directory is specified, ls will list the contents of the directory, not the directory itself. Use this option in conjunction with the -l option to see details about the directory rather than its contents.
Command quiz: ls -F
This option will append an indicator character to the end of each listed name. For example, it will append a forward slash (/) if the name is a directory.
Command quiz: ls -hl
In long format listings, display file sizes in human-readable format rather than in bytes.
Command quiz: ls -S
Sort results by file size.
Command quiz: ls -t
Sort by modification time.
What is the meaning of each category in the long format?
-rw-r–r– 1 root root 3576296 2017-04-03 11:05 Experience ubuntu.ogg
-rw-r–r–
Access rights to the file. The first character indicates the type of file. Among the different types, a leading dash means a regular file, while a d indicates a directory. The next three characters are the access rights for the file’s owner, the next three are for members of the file’s group, and the final three are for everyone else. Chapter9 discusses the full meaning of this in more detail.
1
File’s number of hard links. See “Symbolic Links” on page 21 and “Hard Links” on page 22.
root
The username of the file’s owner.
root
The name of the group that owns the file.32059Size of the file in bytes.
2017-04-03 11:05
Date and time of the file’s last modification.
oo-cd-cover.odf
Name of the file.
Command quiz: file hello.jpg
The file command will print a brief description of the file’s contents.