File system Flashcards
(34 cards)
Which command should we use to know current directory/ current location?
pwd
Current directory/location can be referenced by…
. in commands
Directory above the current directory can be referenced by…
.. in commands
Absolute path
specifies the path of a file/ directory regardless of the current location
Relative path
specifies the path of a file/ directory which is relative to the current location
display the content of a directory
ls
List All Files including hidden files
Hidden files start with a .
Commonly used for storing user preferences
ls -a
List files in reverse order
ls -r
List files in Recursive list
ls -R
can be used to view a hierarchical structure of the file system
tree
user’s home folder
~ (tilde character)
navigate your way to other directories
cd
create a directory/ multiple directories
mkdir
create subdirectory and parent(s). Required if parent(s) do(es) not pre-exist
mkdir -p dir1/sub2/sub3
remove empty directories
rmdir
remove directories with or without content
rm -r
create files
vi/ vim
touch: creates files, but also has another purpose which is to update time stamp if the file already exists
Display the content of a file
cat
Display a % of the file starting from the beginning
more
Display a screenful of the file starting from the beginning
less
Display the first 10 lines of a file
head
Display the last 10 lines of a file
tail
removes file
rm filename
copy files
cp filename newfilename