WorksheetsLinux - Recitation
Total questions: 15
Worksheet time: 3mins
Lists all files and directories in the present working directory
ls
LS
ls -a
ls -al
Lists files and directories with long listing format
ls
LS
ls -a
ls -al
Change to HOME directory
cd ~
cd \
cd /
cd ..
Moves directory to previous
cd ~
cd \
cd /
cd ..
Moves to the root directory
cd ~
cd \
cd /
cd ..
Creates a new file
cat >> filename
cat > filename
cat < filename
cat filename
Displays the file content
cat >> filename
cat > filename
cat < filename
cat filename
Merge two or more files and stores in a new file
cat >> filename
cat files > filename
cat < filename
cat file1 file2
Deletes a file
rm file
del file
rem file
erase file
Creates a new directory in the present working directory
md name
mkdir name
rmdir name
cd name
Deletes a directory
md name
mkdir name
rmdir name
cd name
Command used to update packages
sudo apt install
sudo apt update
sudo apt install update
sudo apt get
Gives a list of all past commands typed in the current terminal session
History
history
man
MAN
Command to save create text file using cat
ctrl+d
ctrl+s
ctrl+w
ctrl+a
Display the contents of the working directory, subdirectory, and files recursively
TREE
tree
Tree
pwd
