MATRIX VISION - mvBlueLYNX-M7 Technical Documentation
Appendix B. Linux commands

List of the most important shell commands

Command Description Example
[command] & You can continue to use the shell
eclipse & 
[command] && [command] Command will be executed one after the other
eclipse && kate 
man [program] Show the manual of the program
man cp 
Control + C Cancel the current process of in the shell
strg + C 
Directory, files
cd [directory] Change the directory
cd /tmp 
cd .. Change on one hierarchy higher
cd ../ 
cd / Change to the root directory
cd / 
cd Change the directory
cd .. ; cd /tmp 
cd - Change to the previous directory
cd - 
cp [options][file][directory] Copy file into the directory ,ask before overwrite and print verbose information
cp -vi 123.txt /tmp 
mv [options][file][directory] Move a file, ask before overwrite and print verbose information
mv -vi 123.txt /tmp 
mv [file1][file2] Rename file [file1] to [file2]
mv 123.txt 456.txt 
rm [options][file] Remove a file, ask before remove and print verbose information
rm -vi /tmp/123.txt ; rm /tmp/* 
rm -rf Remove all below the directory
rm -rf /tmp/ 
mkdir Make a directory
mkdir /home/test 
rmdir Remove a directory
rmdir /home/test 
ls List the content of a directory
ls /home/test 
ls -l Detailed list of the content
ls -l /home/test 
ls -la All files of the directory in Detail
ls -la /home/test 
alias ls='ls –color' Set a colored display
alias ls='ls --color' 
pwd Show the current directory
pwd 
cat [file] Show the content of a file
cat 123.txt 
more [file] Show the content of a file page by page
more 123.txt 
touch [file] Create an empty file
touch 123.txt 
whereis [Prog] Search for a program
whereis eclipse 
find . | grep [file] Search for a file in the current directory
find . | grep 123.txt 
grep [KEYWORD] [file] Search for a keyword in a file
grep whatever 123.txt 
locate [file] Locate file in a database
locate 123.txt 
updatedb Update database
updatedb 
which Show, where the program is placed
which eclipse 
System
arch Processor family
arch 
cat /proc/filesystems Supported filesystems
cat /proc/filesystems 
cat /proc/cpuinfo Information about CPU
cat /proc/cpuinfo 
dmesg | grep sd Information about all drives
dmesg | grep sd 
date Date and time
date 
dmesg Kernel logger: shows Kernel activities
dmesg 
free Show usage of memory
free 
kill [PID] Kill the process with the corresponding ID
kill 1067 
killall [Prog] Kill process with the specific name
killall eclipse 
lspci [options] Information about the PCI components (-v for detailed output)
lspci -v 
shutdown -h now Shutdown the PC
shutdown -h now 
shutdown -r now Reboot the PC
shutdown -r now 
top Show program name and CPU load
top 
uptime Show the uptime of the PC
uptime 
X -version Show the version of Xfree
X -version 
Hard disk
df Show the disk space
df -h 
fdisk Partition the hard disk
fdisk /dev/sda 
mkfs.vfat Format the hard disk with vfat
mkfs.vfat /dev/sda1 
mkfs.ext3 Format the hard disk with ext3
mkfs.ext3 /dev/sda1 
sync Save the buffered data on hard disk
sync 
Mount
mount Mount a volume to the system
mount /dev/sda1 /mnt/win 
mount -t [Filesystem] Mount a volume to the system with the specific file system
mount -t ntfs /dev/sda5 /mnt/win_xp 
mount -a Mount a volumes from /etc/fstab
mount -a 
mount -r Volume is read-only
mount -r /mnt/win 
mount -w It is also allowed to write on the volume
mount -w /mnt/win 
mount -m Mount without an entry in /etc/mtab
mount -n /mnt/win 
User
id Show user and group
id 
whoami Show the current user
whoami 
who Show all logged in users
who 
groupadd [group] Create a new group
groupadd admins 
groupdel [group] Delete a new group
groupdel admins 
useradd -m [user] Create user and home directory
useradd -m chef 
userdel -r [user] Delete user and home directory
useradd -m chef 
passwd [user] Change password of the user
passwd chef 
su Work as root in the shell
su 
su [user] work as specific [user] in the shell
su chef 
Network
ifconfig Show network information
ifconfig 
ping [PC] Test connection to a PC
ping 192.168.0.1 
Kernel and modules
lsmod Show all loaded modules
lsmod 
make menuconfig Setup the Kernel
cd /usr/src/linux;
make menuconfig 
modprobe [module] Load a module
modprobe e1000 
uname -a Show Kernel version
uname -a 
Misc.
ps aux Show all running processes and services
ps aux