UNIX/LINUX COMMANDS Flashcards
ls
List.
It will display a list of all files in the current folder, or in the target folder if specified.
For example, “ls /record/finance/*.xls” would list all of the files that end in .XLS, within the
finance folder, inside of the record folder.
pwd
Print Working Directory.
It will show you what folder you are currently in.
cd
Change Directory.
This allows you to change to whatever directory you specify. (This also
works in Windows!)
cp
Copy.
This command copies a file. Proper syntax is “cp [file to be copied] [destination].”
mv
Move.
This command moves one or more files or directories from one location to another.
Proper syntax is mv [options] [source] [destination].
rm
Remove. This deletes the specified files or folders.
grep
A very versatile searching utility, Grep can search any plain-text data set for a specific
“regular expression” which is a fancy way of saying search for a predefined string of
characters. Syntax is grep [options] [pattern] [file name].
Example: grep “find_this_pattern” file123. This would display any line in document “file
123” that contained “find_this_pattern”.
passwd
Password.
This command is used to change a user’s password.
sudo
Superuser Do. This command would be put in front of any command that we want to
execute with superuser (elevated/restricted) privileges. Most systems will request a
password be entered and checked before proceeding.
chmod
Change Modes. This command is used to change the permissions on an object (file).
chown
Change Owner.
This command assigns a new owner to an object (file) and this includes
granting all of the permissions/privileges that would be associated with ownership.
Requires root permissions to use, so it should be proceeded by sudo.
ps
Processes.
Displays a list of all currently running process (programs/services) for the user.
kill
Sends a signal to a running process, to by default, terminate (close). However, kill can be
used to send other instructions if done properly!
ifconfig
Interface Configure.
Similar to ipconfig in Windows, it shows the current configuration of
the network interface card.
cat
Concatenate.
Reads a file and prints contents to the screen.