3. Introduction To Linux Commands Flashcards
What command lists the files and sub-directories in a given directory(displays the contents of a directory)?
The “ls” command
How would you list the files and directories in a directory you are not currently in?
ls “directory path”
The path can either be an absolute path or a relative path
How would you list the contents of a directory, including the hiding files and sub-directories?
ls -a
Which command is used to create a new user in Linux?
sudo adduser username
In Linux which command is used to display the name of the current user?
whoami
What is the sudo command?
It is a command used to give the current user temporary admin privileges.
What type of user is created with the “sudo adduser username” command?
A regular user with no admin privillages.
Which command will you use to create a user with admin privileges?
sudo -u root adduser username
What command is used to clear the screen of your terminal?
clear
What command is used from one directory to another?
cd path
NB: The path can be relative or absolute
What command is used to move to the previous directory you were in?
cd -
Where are the command files found in Linux?
The bin and sbin directories.
The bin directory contains regular commands, while the sbin directory contains commands meant to be executed by admins(the types of commands you will need to add sudo to, to make it work)
What command is used to change the current user’s password?
passwd
What is the purpose of the cat command?
Concatinitinating the content of files and displaying said contents on the terminal.
Using the cat command how will you display the contents of a file?
cat filename.extension