5. Fundermental Daily Linux Commands Flashcards
What is the difference between ls and ll?
The ls command displays the contents of a given directory.
The ll command not only displays the content but also the content alongside their permissions, creator, date of creation, etc.
What commands can be used to display the contents of a directory alongside their permissions, creator, date of creation, etc?
Either you use ls -l or ll
Which command is used to display all contents of the directory including hidden files and sub-directories?
ls -a
What commands will be used to display the contents of a directory arranged in ascending or descending order by modification time?
ll -tr, for ascending order
ll -t, for descending order
What command is used to switch the user’s home directory?
cd ~
What command is used to display the current directory a user is in?
pwd
Which command is used to create a new directory?
mkdir directory_name
Which command is used to create nested directories?
mkdir -p dir/dir1/dir2/………./dirn
or
mkdir -pv dir/dir1/dir2/………./dirn, for more detailed information about the created directories
Which command is used to create a file in Linux?
touch filename.ext
What command is used to display text on the terminal?
echo “text”
What command is used to display the tree structure of a directory?
tree
What command is used to copy and paste files in Linux?
cp filename.ext destination_directory
What command is used to move(cut and paste) files in Linux?
mv filename.ext destination_directory
What command is used to delete a file in Linux?
rm filename.txt
What command is used to delete a directory in Linux?
rm -r directory_name
or
rm -rf directory_name ( to remove the directory forcefully)