Linux Commands Flashcards
what is cmd to clear the screen in terminal?
clear (short cut: Ctrl + L)
What is the cmd to show the current working directory?
pwd
What is the cmd to list the folders of the current directory?
ls
what is the cmd to list all the processes currently running?
ps
What is the cmd to get the operation system which is currently running?
uname
What is the cmd to end the terminal / shell?
exit (shortcut : Ctrl + d)
what does command “ls- a” do?
Will list all hidden files which start with a “.”
what does command “ls- l” do?
List the list of visible files in a long format
what command is used to access the help manuals built in?
man <option> <command></command></option>
What is the File System Hierarchy Standard which is currently used?
FHS 3.0 released on June 03, 2015
What is the file system structure
Level 0 - root (/)
Level 1 - sbin , media, bin, etc(apt),home(lenin,Desktop, Documnents, Downloads, Pictures, MyCode), tmp, user(bin, sbin,share),lib, var,mnt
File System: traversing the tree
/ is the root of the file system
/ is also the delimiter for sub-directories
. is current directory
.. is parent directory
path for traversal can be absolute or relative
What are the components of typical output of ls -l ?
drwxr -xr -x 5 gphani gphani 12288 Nov 25 10:00 Documents
here “d” denotes file type , here it is directory
rwx (owner permissions)
r-x (Group permissions, - denotes no permission)
r -x (Others permissions)
5 - Number of hard links
gphani - owner
gphani - group (by default there is a group in every user name)
12288 - size
Nov 25 10:00 - Last modified timestamp
Documents - filename
in ls -l format , what does the file descriptor say?
L stands for link to a different directory( like a shortcut)
D stands for directory
- symbolizes regular file
d symbolizes Directory
l symbolizes symbolic link
c symbolizes character file
b symbolizes block file
s symbolizes socket file
p symbolizes Named pipe
C stands for character file which could be read
B stands for Block devices like HDD where data will be read/written in blocks. Typical linux block size is 1Kb
What is an inode?
ls -i <name>
An entry in the filesystem table about the location in storage media
Each unique file will have a unique inode.
If there are multiple entries for the same inode then they are called hard links</name>