Environment Variables, Aliases Flashcards
When performing a long listing what do the objects show?
permissions links owner group size datemodified file/directory
i.e drwxr-xr-x. 2 cloud_user cloud_user 6 Oct 15 16:20 Desktop
How do you list files/directories?
ls
How do you list files/directories in order of size?
ls -S
i.e ls -lS
How do you do a detailed listing of files/directories?
ls -l
How do you do a reverse listing?
ls -r
How do you list a directory including its contents?
ls -R
How do you list in order of modification time?
ls -t
How do you get a listing of environment variables?
env
How do you view the directory locations bash will look in when entering a command?
echo “$PATH”
contained in the PATH environment variable
How do you reference something in the current directory?
.
i. e ./script1
* dot source
What is the command to list the current user?
whoami
What is the command to switch user?
su
i.e su user2
What is the command to switch the the root user?
su - *resets env variables
su *just switches user
What is the command to run as root interactively without the root password?
sudo -i
*useful if no root password exists (common)
What is the command to print the name of the OS?
uname
-r release -v kernel build -m/-p architecture -o os name -a all