You are on page 1of 30

Basic Linux Commands from A+

Basic Linux commands:


- rm - dd
- ls - chmod
- grep - chown
- cd - iwconfig/ifconfig
- shutdown - ps
- pwd vs. passwd - su/sudo
- mv - apt-get
- cp - vi
Basic Linux Commands from A+
Ls
The ls command lists files and directories
within the current working directory,
allowing admins to see when configuration
files were last edited.

https://www.rapidtables.com/code/linux/ls.html
Basic Linux Commands from A+
grep
grep searches files for a given character
string or pattern and can replace the string
with another. This is one method of
searching for files within Linux. (kind of like the
find function of ctrl-f)

https://www.lifewire.com/linux-grep-command-3571842
Basic Linux Commands from A+
cd
The cd command changes the current
directory in Linux and can toggle between
directories conveniently. Cd is similar to the
CD and CHDIR commands in MS-DOS.

https://www.computerhope.com/unix/ucd.htm
Basic Linux Commands from A+
shutdown
The shutdown command can be used to shutdown a
system or restart it. It is commonly used to shutdown or
reboot both local and remote machines.
Shutdown arranges for the system to be brought down in a safe way.
All logged-in users are notified that the system is going down and,
within the last five minutes of TIME, new logins are prevented.

http://www.binarytides.com/linux-command-shutdown-reboot-restart-system/
Basic Linux Commands from A+
pwd vs. passwd
pwd - the pwd (print working directory) command displays the
name of the current working directory. This is a basic Linux
command.
http://searchdatacenter.techtarget.com/tutorial/77-Linux-commands-and-utilities-youll-actually-use

passwd - passwd updates a user's authentication tokens (changes


their current password).
https://stackoverflow.com/questions/9596108/how-do-i-change-my-password-in-linux
Basic Linux Commands from A+
mv
moves, or renames, files and directories on your
filesystem.

https://www.computerhope.com/unix/umv.htm
https://www.linux.com/learn/how-move-files-using-linux-commands-or-file-managers
Basic Linux Commands from A+
cp
copies files and directories; copies can be made
simultaneous to another directory if the copy is
under a different name.

https://www.computerhope.com/unix/ucp.htm
https://www.rapidtables.com/code/linux/cp.html
https://www.howtoforge.com/linux-cp-command/
Basic Linux Commands from A+
rm
The rm ("remove") command is used to delete files. When used recursively, it
may be used to delete directories.

https://www.computerhope.com/unix/urm.htm
https://www.techonthenet.com/linux/commands/rm.php
https://www.linuxtechi.com/rm-command-examples-for-beginners/
https://www.linuxhelp.com/rm-command/
Basic Linux Commands from A+
chmod
used to change the permissions of files or directories.
On Linux and other Unix-like operating systems, there is a set of rules for each
file which defines who can access that file, and how they can access it. These
rules are called file permissions or file modes. The command name chmod
stands for "change mode", and it is used to define the way a file can be
accessed.
https://www.computerhope.com/unix/uchmod.htm
https://www.linux.org/threads/command-chmod.291/
https://www.linuxhelp.com/chmod-command/
https://en.wikipedia.org/wiki/Chmod
Basic Linux Commands from A+
chown
The chown command changes ownership of files and directories in a Linux
filesystem.
Linux is designed to support a large number of users. Because of this, it needs
to keep careful track of who is allowed to access a file, and how they can
access it. These access rules are called permissions.
For example, chown jim file changes the ownership of the file to Jim.

https://www.computerhope.com/jargon/u/user.htm
https://www.techonthenet.com/linux/commands/chown.php
https://www.tutorialspoint.com/unix_commands/chown.htm
https://www.linux.org/threads/chown-command.4311/
Basic Linux Commands from A+
ifconfig / iwconfig
ifconfig in short “interface configuration” utility for system/network
administration in Unix/Linux operating systems to configure, manage and
query network interface parameters via command line interface
The “ifconfig” command is used for displaying current network configuration
information, setting up an ip address, netmask or broadcast address to an
network interface, creating an alias for network interface, setting up hardware
address and enable or disable network interfaces

https://www.linux.org/threads/chown-command.4311/
https://www.linuxhelp.com/ifconfig-command/
Basic Linux Commands from A+
ifconfig / iwconfig
So what is iwconfig? It is a CLI command that allows you
to set and change parameters of a wireless card. You
can also use it to list the current wireless parameters set
on a card.
https://www.computerhope.com/unix/iwconfig.htm
https://www.techrepublic.com/blog/linux-and-open-source/using-iwconfig-to-
configure-settings-on-wireless-cards/
https://en.wikipedia.org/wiki/Wireless_tools_for_Linux
https://www.linuxquestions.org/questions/linux-wireless-networking-41/ifconfig-vs-
iwconfig-268525/
Basic Linux Commands from A+
ps
one of the most basic commands for viewing the processes running on
the system. It provides a snapshot of the current processes along with
detailed information like user id, cpu usage, memory usage,
command name etc.

http://www.binarytides.com/linux-ps-command/
https://www.techonthenet.com/linux/commands/ps.php
Basic Linux Commands from A+
su
The su command is used to become another user during a login session.
Invoked without a username, su defaults to becoming the superuser.
In computing, the superuser is a special user account used for system
administration. Depending on the operating system (OS), the actual
name of this account might be root, administrator, admin or supervisor

https://www.techonthenet.com/linux/commands/su.php
https://en.wikipedia.org/wiki/Superuser
Basic Linux Commands from A+
sudo
Sudo, the one command to rule them all. It stands for “super user
do!” Pronounced like “sue dough”
So what does sudo actually do? If you prefix “sudo” with any linux command,
it will run that command with elevated privileges. Elevated privileges are
required to perform certain administrative tasks.

https://linuxacademy.com/blog/linux/linux-commands-for-beginners-sudo/
https://www.lifewire.com/what-to-know-sudo-command-3576779
https://askubuntu.com/questions/376199/sudo-su-vs-sudo-i-vs-sudo-bin-bash-when-
does-it-matter-which-is-used
https://www.linux.com/blog/how-use-sudo-and-su-commands-linux-introduction
Basic Linux Commands from A+
apt-get
APT is acronym for Advanced Package Tool. It supports installing packages
over the internet using FTP or HTTP protocols. In other words, apt-get is the
command-line tool for installing packages on your system.

https://www.computerhope.com/unix/apt-get.htm
https://itsfoss.com/apt-get-linux-guide/
https://www.cyberciti.biz/tips/linux-debian-package-management-cheat-
sheet.html
http://www.techradar.com/how-to/computing/everything-you-need-to-know-
about-linux-commands-1321955/2
Basic Linux Commands from A+
vi
vi (pronounced "vee-eye") is a visual text editor. It runs in “command
mode” to cause actions to be taken on a file and “insert mode” to insert
text into a file.

https://www.computerhope.com/unix/uvi.htm
http://www.cs.colostate.edu/helpdocs/vi.html
https://www.howtogeek.com/102468/a-beginners-guide-to-editing-text-files-with-vi/
https://www.lifewire.com/linux-command-vi-vim-unix-command-gvim-4093596
Basic Linux Commands from A+
dd
The dd command is actually a reference to the DD statement from IBM’s Job
Control Language and means Data Description. However, many prefer to think
of it as “data duplicator” because the primary purpose of dd is to convert and
copy files. With dd you can easily copy a partition or an entire drive. Dd is a
very powerful command and must be syntaxed (formatted) correctly or you
can accidently erase all of your data instead of copying it. Hence, it is
sometimes refered to as data destroyer.

https://linoxide.com/linux-command/linux-dd-command-create-1gb-file/
https://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/
https://www.linux.com/learn/full-metal-backup-using-dd-command
https://en.wikipedia.org/wiki/Dd_%28Unix%29
Linux Commands from other sources:
cat
To Concatenate files. Concatenation means putting
multiple file contents together. The original file or files are
not modified or deleted.
---to link together; unite in a series or chain.
http://www.dictionary.com/browse/concatenate

https://www.cyberciti.biz/faq/howto-use-cat-command-in-unix-linux-shell-script/
https://www.lifewire.com/uses-of-linux-cat-command-4011235
https://www.computerhope.com/unix/ucat.htm
https://shapeshed.com/unix-cat/
Linux Commands from other sources:
more
The more command allows you to display output to the terminal one page at a
time. This is especially useful when running a command which causes a lot of
scrolling such as the ls command or the du command.

https://www.lifewire.com/what-to-know-more-command-4051953
https://www.computerhope.com/unix/umore.htm
Linux Commands from other sources:
top
The top command is used to show all the running processes within your Linux
environment. It provides a dynamic real-time view of a running system. It can
display system summary information, as well as a list of processes or threads
currently being managed by the kernel. As the name suggests, it shows the top
processes based on certain criterias like cpu usage or memory usage.

https://www.lifewire.com/linux-top-command-2201163
https://www.computerhope.com/unix/top.htm
http://www.binarytides.com/linux-top-command/
Linux Commands from other sources:
kill pid
The kill command is used on Linux and other Unix-like operating systems to
terminate processes without having to log out or reboot (i.e., restart) the
computer. Thus, it is particularly important to the stability of such systems.
A process, also referred to as a task, is an executing (i.e., running) instance of a
program. Each process is automatically assigned a unique process
identification number (PID) when it is created for use by the system to
reference the process.

http://www.linfo.org/kill.html
https://www.computerhope.com/unix/ukill.htm
https://www.linux.com/learn/intro-to-linux/2017/5/how-kill-process-command-line
Linux Commands from other sources:
killall [name]
kills all the processes by the name specified.
kill and killall are utilized mainly to efficiently and cleanly
terminate programs that have frozen and thus cannot be closed
by conventional means (menu option or GUI button).
They eliminate the need to reboot (restart the computer) in order
to close the program.
http://www.linfo.org/killall.html
https://www.lifewire.com/how-to-kill-processes-using-linux-4062677
https://www.2daygeek.com/kill-terminate-a-process-in-linux-using-kill-pkill-killall-command/
https://www.computerhope.com/unix/killall.htm
https://www.howtoforge.com/linux-killall-command/
Linux Commands from other sources:
man
format and display the on-line manual pages.

https://www.computerhope.com/unix/uman.htm
https://www.lifewire.com/man-linux-command-4095406
http://www.linfo.org/man.html
https://www.linux.org/docs/
Linux Commands from other sources:
df
tool for checking disk space utilization in Linux.
stands for “disk filesystem“ and it is used to get full
summary of available and used disk space usage of a
file system within a Linux system. A.k.a. disk free.

https://www.computerhope.com/unix/udf.htm
https://www.tecmint.com/how-to-check-disk-space-in-linux/
https://www.lifewire.com/check-disk-space-commands-df-du-2201111
https://www.linux.com/learn/linux-tips-misunderstood-df-command
Linux Commands from other sources:
du
disk usage: The du command summarizes the disk
usage of each file. It is a standard Unix/Linux
command, used to check the information of disk usage
of files and directories on a machine.
https://www.lifewire.com/uses-of-linux-command-du-2201099
https://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/
http://www.linfo.org/du.html
https://www.lifewire.com/check-disk-space-commands-df-du-2201111
https://www.linux.com/blog/linux-101-check-disk-space-command
https://www.lifewire.com/check-disk-space-commands-df-du-2201111
https://www.linux.com/blog/linux-101-check-disk-space-command
https://www.thegeekstuff.com/2012/06/du-command-examples/
Basic Linux Permissions:
-rwxr-xr--
File permissions define which user or system accounts have permissions to read,
write, and execute specific files.
These read, write, and execute permissions are defined for: user, group, other.
In the example above the first “-” indicates a regular file. The first “rwx” means
that the user (owner) has read, write, and execute premissions. The following
“r-x” indicates the group have read and execute permissions but not write.
Then the following “r—” indicate that other (everyone else) has read
permissions only.
http://www.tutonics.com/2012/12/linux-file-permissions-chmod-umask.html
https://networking.ringofsaturn.com/Unix/unixpermissions.php
https://www.elated.com/articles/understanding-permissions/
Basic Linux stuff to know:
SE Linux
Security-Enhanced Linux (SELinux) is a Linux kernel security module that provides a
mechanism for supporting access control security policies, including United States
Department of Defense–style mandatory access controls (MAC).
The original authors were the NSA (National Security Agency) and RedHat. RedHat,
Inc. is an American multinational software company providing open-source software
products to the enterprise community.

https://en.wikipedia.org/wiki/Security-Enhanced_Linux
https://selinuxproject.org/page/Main_Page
https://www.linux.com/answers/what-selinux-and-how-does-it-work
https://www.nsa.gov/what-we-do/research/selinux/
https://www.nsa.gov/what-we-do/research/
https://en.wikipedia.org/wiki/Red_Hat
Basic Linux Commands
Other References that may be useful:

https://www.computerworld.com/article/2598082/linux/linux-linux-command-line-cheat-sheet.html
http://searchdatacenter.techtarget.com/tutorial/77-Linux-commands-and-utilities-youll-actually-use
https://www.linux.com/learn/how-use-linux-command-line-basics-cli
https://www.computerhope.com/unix.htm
https://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/

You might also like