Comands
whoami - lists the user that you are logged in as
usermod - can change and access the shell of a user after it is created
apt-cache search - allows you to look up apt cache for a repository you want to download.
uname - displays system information
pwd - prints the working directory you are in
type - the type command displays information about a command
which - searches for the location of a command in the system / wear it resides
man - when man is added with another command, it will pull up information about another command in another window
ls -l will list the directories as a list and when they were last accessed
rm - removes/deletes files (sometimes need root)
touch - This will paired along with the file name, which will create the file
echo - This will echo to have the terminal spit back out what you said to it
export [variable]=[variable] - this will set a variable equal to another variable and save it to the system. When you do echo $, this will display the variable
unset [variable] - will delete the variable you set
history - will show the history of the commands and when they were last used
!! - put the last command you just did in the next terminal line
You can chain multiple commands together using the ; it looks something like this
Chmod - This changes the permissions for a file if they have been read right or executed. More documentation can be found in the Permissionssection.
locate - looks for a file with in the file system
However, if you just created a file and didn't update the database, then it won't show up. To update the database, you can do
find — The find command looks for files in your filesystem in real time. However, this just takes a long time.
In the image above, you can see that I located the name Empire in the empire directory.
In the image above, you can see that you are looking for two conditions in your search using locate. First, the . will indicate the current directory, then is the one owned by sysadmin. The other option, separated by the —o, indicates that the name of the file must be Downloads. As you can see by the picture, many directories popped up.
whereis -
head - shows the top of a file
tail - shows to the bottom of a file
stat - tells you information about the file, including time stamps and size and more
Last updated