Appendix A: Shell Commands
Here I provide some useful commands and executables in shell which is portable on Linux or Unix based systems (Ubuntu, Debian, MacOS, Cygwin, …). For detailed description on how to use these commands, use <command> --help
, man <command>
, info coreutils <command>
, or google them.
Some of the executables (such as gcc
) does not come with some systems themselves. You might need to install them first. Just google <OS> how to install <package>
.
Executable / Command | Stand For | Short Description |
---|---|---|
bash |
Bourne-Again shell | The most used shell |
bg |
background | Make a process run in background |
cat |
concatenate | Show contents of a file or stdin |
cd |
change directory | Change directory |
chmod |
change mode | Change access permissions of files |
chown |
change owner | Change the owner of files |
cp |
copy | Copy a file to another path |
diff |
difference | Check the difference between files |
echo |
echo | Print something |
fg |
foreground | Bring a background job to foreground |
gcc |
GNU compiler collection | The compiler collection for C, C++, and Fortran |
grep |
g/re/p : global regular expression print |
Search in files or streams for lines that match a regular expression |
id |
identity | Print user and group information |
jobs |
jobs | Check status of jobs running in current terminal |
kill |
kill | Send a signal to a process (not necessarily SIGKILL !) |
ls |
list contents | List contents in a directory |
man |
manual | Manual for commands |
mv |
move | Move a file or directory to another path |
ps |
process | Check processes running in the system |
pwd |
print working directory | Print the full path of current directory to stdout |
rm |
remove | Delete a file |
scp |
secure copy | Copy or transfer files to a remote endpoint |
sed |
stream editor | Edit a file or stream with command-line |
sh |
shell | The most basic shell with few features |
sleep |
sleep | Suspends program execution for a specified time |
ssh |
secure shell | A remote login interface and shell |
su |
switch user | Switch to and login as another user |
sudo |
super user do | Execute a command in elevated privilege (root) |
tar |
tape archive | Pack files and have the ability to compress |
top |
table of processes | A real-time process monitor |
touch |
touch | Create a file, or change and modify timestamps of a file |
tr |
translate | Substitute contents, or select or delete contents from input |
vi |
visual instrument | A visual editor |
vim |
vi improved |
A better visual editor |
which |
which | Identify the location of a given executable in PATH |
Comment below with different methods!
GitHub Issues