Questions and Answers
Bash Linux commands
1.
Add a user to the system
Adduser
2.
Add a group to the system
Addgroup
4.
Search Help manual pages (man -k)
apropos
5.
Search for and install software packages (Debian)
apt-get
7.
Find and Replace text, database sort/validate/index
awk
8.
Strip directory and suffix from filenames
basename
9.
GNU Bourne-Again SHell
bash
10.
Arbitrary precision calculator language
bc
12.
Exit from a loop •
break
13.
Run a shell builtin
builtin
14.
Compress or decompress named file(s)
bzip2
15.
Display a calendar
cal
16.
Conditionally perform a command
case
17.
Display the contents of a file
cat
19.
Partition table manipulator for Linux
cfdisk
20.
Change group ownership
chgrp
21.
Change access permissions
chmod
22.
Change file owner and group
chown
23.
Run a command with a different root directory
chroot
24.
System services (runlevel)
chkconfig
25.
Print CRC checksum and byte counts
cksum
26.
Clear terminal screen
clear
28.
Compare two sorted files line by line
comm
29.
Run a command - ignoring shell functions •
command
30.
Resume the next iteration of a loop •
continue
31.
Copy one or more files to another location
cp
32.
Daemon to execute scheduled commands
cron
33.
Schedule a command to run at a later time
crontab
34.
Split a file into context-determined pieces
csplit
35.
Divide a file into several parts
cut
36.
Display or change the date & time
date
38.
Convert and copy a file, write disk headers, boot records
dd
39.
Data recovery tool
ddrescue
40.
Declare variables and give them attributes •
declare
41.
Display free disk space
df
42.
Display the differences between two files
diff
43.
Show differences among three files
diff3
45.
Briefly list directory contents
dir
46.
Colour setup for `ls'
dircolors
47.
Convert a full pathname to just a path
dirname
48.
Display list of remembered directories
dirs
49.
Print kernel & driver messages
dmesg
50.
Estimate file space usage
du
51.
Display message on screen •
echo
52.
Search file(s) for lines that match an extended expression
egrep
53.
Eject removable media
eject
54.
Enable and disable builtin shell commands •
enable
55.
Environment variables
env
56.
Ethernet card settings
ethtool
57.
Evaluate several commands/arguments
eval
58.
Execute a command
exec
60.
Automate arbitrary applications accessed over a terminal
expect
61.
Convert tabs to spaces
expand
62.
Set an environment variable
export
63.
Evaluate expressions
expr
64.
Do nothing, unsuccessfully
false
65.
Low-level format a floppy disk
fdformat
66.
Partition table manipulator for Linux
fdisk
67.
Send job to foreground
fg
68.
Search file(s) for lines that match a fixed string
fgrep
69.
Determine file type
file
70.
Search for files that meet a desired criteria
find
71.
Reformat paragraph text
fmt
72.
Wrap text to fit a specified width.
fold
73.
Expand words, and execute commands
for
74.
Format disks or tapes
format
75.
Display memory usage
free
76.
File system consistency check and repair
fsck
77.
File Transfer Protocol
ftp
78.
Define Function Macros
function
79.
Identify/kill the process that is accessing a file
fuser
80.
Find and Replace text within file(s)
gawk
81.
Parse positional parameters
getopts
82.
Search file(s) for lines that match a given pattern
grep
83.
Print group names a user is in
groups
84.
Compress or decompress named file(s)
gzip
85.
Remember the full pathname of a name argument
hash
86.
Output the first part of file(s)
head
87.
Display help for a built-in command •
help
88.
Command History
history
89.
Print or set system name
hostname
90.
Print user and group id's
id
91.
Conditionally perform a command
if
92.
Configure a network interface
ifconfig
93.
Stop a network interface
ifdown
94.
Start a network interface up
ifup
95.
Capture an X server screen and save the image to file
import
96.
Copy files and set attributes
install
97.
Join lines on a common field
join
98.
Stop a process from running
kill
99.
Kill processes by name
killall
100.
Display output one screen at a time
less
101.
Perform arithmetic on shell variables •
let
102.
Make links between files
ln
103.
Create variables •
local
105.
Print current login name
logname
106.
Exit a login shell •
logout
107.
Display lines beginning with a given string
look
108.
Line printer control program
lpc
111.
Abort a print job
lprintd
112.
List the print queue
lprintq
113.
Remove jobs from the print queue
lprm
114.
List information about file(s)
ls
116.
Recompile a group of programs
make
118.
Create new folder(s)
mkdir
119.
Make FIFOs (named pipes)
mkfifo
120.
Create an hybrid ISO9660/JOLIET/HFS filesystem
mkisofs
121.
Make block or character special files
mknod
122.
Display output one screen at a time
more
123.
Mount a file system
mount
124.
Manipulate MS-DOS files
mtools
125.
Move or rename files or directories
mv
126.
Mass Move and rename (files)
mmv
127.
Networking information
netstat
128.
Set the priority of a command or job
nice
129.
Number lines and write files
nl
130.
Run a command immune to hangups
nohup
131.
Query Internet name servers interactively
nslookup
132.
Open a file in its default application
open
134.
Modify a user password
passwd
135.
Merge lines of files
paste
136.
Check file name portability
pathchk
137.
Test a network connection
ping
138.
Stop processes from running
pkill
139.
Restore the previous value of the current directory
popd
140.
Prepare files for printing
pr
141.
Printer capability database
printcap
142.
Print environment variables
printenv
143.
Format and print data •
printf
145.
Save and then change the current directory
pushd
146.
Print Working Directory
pwd
147.
Display disk usage and limits
quota
148.
Scan a file system for disk usage
quotacheck
149.
Set disk quotas
quotactl
151.
Copy files between two machines
rcp
152.
Read a line from standard input •
read
153.
Read from stdin into an array variable •
readarray
154.
Mark variables/functions as readonly
readonly
155.
Reboot the system
reboot
157.
Alter priority of running processes
renice
158.
Synchronize remote files via email
remsync
159.
Exit a shell function
return
160.
Reverse lines of a file
rev
162.
Remove folder(s)
rmdir
163.
Remote file copy (Synchronize file trees)
rsync
164.
Multiplex terminal, run remote shells via ssh
screen
165.
Secure copy (remote file copy)
scp
166.
Merge two files interactively
sdiff
168.
Accept keyboard input
select
169.
Print numeric sequences
seq
170.
Manipulate shell variables and functions
set
171.
Secure File Transfer Program
sftp
172.
Shift positional parameters
shift
174.
Shutdown or restart linux
shutdown
175.
Delay for a specified time
sleep
178.
Run commands from a file `.'
source
179.
Split a file into fixed-size pieces
split
180.
Secure Shell client (remote login program)
ssh
181.
Trace system calls and signals
strace
182.
Substitute user identity
su
183.
Execute a command as another user
sudo
184.
Print a checksum for a file
sum
185.
Make a new name for a file
symlink
186.
Synchronize data on disk with memory
sync
187.
Output the last part of files
tail
189.
Redirect output to multiple files
tee
190.
Evaluate a conditional expression
test
191.
Measure Program running time
time
192.
User and system times
times
193.
Change file timestamps
touch
194.
List processes running on the system
top
195.
Trace Route to Host
traceroute
196.
Run a command when a signal is set(bourne)
trap
197.
Translate, squeeze, and/or delete characters
tr
198.
Do nothing, successfully
true
199.
Topological sort
tsort
200.
Print filename of terminal on stdin
tty
201.
Describe a command •
type
202.
Limit user resources •
ulimit
203.
Users file creation mask
umask
204.
Unmount a device
umount
205.
Remove an alias •
unalias
206.
Print system information
uname
207.
Convert spaces to tabs
unexpand
209.
Convert units from one scale to another
units
210.
Remove variable or function names
unset
211.
Unpack shell archive scripts
unshar
212.
Execute commands (until error)
until
213.
Create new user account
useradd
214.
Modify user account
usermod
215.
List users currently logged in
users
216.
Encode a binary file
uuencode
217.
Decode a file created by uuencode
uudecode
218.
Verbosely list directory contents (`ls -l -b')
v
219.
Verbosely list directory contents (`ls -l -b')
vdir
221.
Report virtual memory statistics
vmstat
222.
Execute/display a program periodically
watch
223.
Print byte, word, and line counts
wc
224.
Search the user's $path, man pages and source files for a program
whereis
225.
Search the user's $path for a program file
which
226.
Execute commands
while
227.
Print all usernames currently logged in
who
228.
Print the current user id and name (`id -un')
whoami
229.
Retrieve web pages or files via HTTP, HTTPS or FTP
Wget
230.
Send a message to another user
write
231.
Execute utility, passing constructed argument list(s)
xargs
232.
Print a string until interrupted
yes
233.
Run a command script in the current shell
.