Commands: Sudo: Executing Commands With Elevated Privileges
Commands: Sudo: Executing Commands With Elevated Privileges
user@computer:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 6.06 LTS
Release: 6.06
Codename: dapper
user@computer:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 6.06 LTS
Release: 6.06
Codename: dapper
user@computer:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 6.06 LTS
Release: 6.06
Codename: dapper
Command privileges.
Command Network
Commands Display
Command System.
Applications commands.
Command Description
# init 0 shutdown system(2) [man]
# logout leaving session [man]
# reboot reboot(2) [man]
# shutdown -h now shutdown system(1) [man]
# shutdown -h 16:30 & planned shutdown of the system at 16:30
[man]
# shutdown -c cancel a planned shutdown of the system
[man]
# shutdown -r now reboot(1) [man]
# telinit 0 shutdown system(3) [man]
Command Description
# cd /home enter to directory '/ home' [man]
# cd .. go back one level [man]
# cd ../.. go back two levels [man]
# cd go to home directory [man]
# cd ~user1 go to home directory [man]
# cd - go to previous directory [man]
# cp file1 file2 copying a file [man]
# cp dir/* . copy all files of a directory within the current
work directory [man]
# cp -a /tmp/dir1 . copy a directory within the current work
directory [man]
# cp -a dir1 dir2 copy a directory [man]
# cp file file1 outputs the mime type of the file as text
[man]
# iconv -l lists known encodings [man]
# iconv -f fromEncoding -t toEncoding converting the coding of characters from one
inputFile > outputFile format to another [man]
# find . -maxdepth 1 -name *.jpg -print batch resize files in the current directory and
-exec convert send them to a thumbnails directory (requires
convert from Imagemagick) [man]
# ln -s file1 lnk1 create a symbolic link to file or directory
[man]
# ln file1 lnk1 create a physical link to file or directory [man]
# ls view files of directory [man]
# ls -F view files of directory [man]
# ls -l show details of files and directory [man]
# ls -a show hidden files [man]
# ls *[0-9]* show files and directory containing numbers
[man]
# lstree show files and directories in a tree starting
from root(2) [man]
# mkdir dir1 create a directory called 'dir1' [man]
# mkdir dir1 dir2 create two directories simultaneously [man]
# mkdir -p /tmp/dir1/dir2 create a directory tree [man]
# mv dir1 new_dir rename / move a file or directory [man]
# pwd show the path of work directory [man]
# rm -f file1 delete file called 'file1' [man]
# rm -rf dir1 remove a directory called 'dir1' and contents
recursively [man]
# rm -rf dir1 dir2 remove two directories and their contents
recursively [man]
# rmdir dir1 delete directory called 'dir1' [man]
# touch -t 0712250000 file1 modify timestamp of a file or directory -
(YYMMDDhhmm) [man]
# tree show files and directories in a tree starting
from root(1) [man]
Command Description
# find / -name file1 search file and directory into root filesystem
from '/' [man]
# find / -user user1 search files and directories belonging to 'user1'
[man]
# find /home/user1 -name \*.bin search files with '. bin' extension within
directory '/ home/user1' [man]
# find /usr/bin -type f -atime +100 search binary files are not used in the last 100
days [man]
# find /usr/bin -type f -mtime -10 search files created or changed within 10 days
[man]
# find / -name *.rpm -exec chmod 755 search files with '.rpm' extension and modify
'{}' \; permits [man]
# find / -xdev -name \*.rpm search files with '.rpm' extension ignoring
removable partitions as cdrom, pen-drive, etc.
… [man]
# locate \*.ps find files with the '.ps' extension - first run
'updatedb' command [man]
# whereis halt show location of a binary file, source or man
[man]
# which halt show full path to a binary / executable [man]
Command Description
# fuser -km /mnt/hda2 force umount when the device is busy [man]
# mount /dev/hda2 /mnt/hda2 mount disk called hda2 - verify existence of the
directory '/ mnt/hda2' [man]
# mount /dev/fd0 /mnt/floppy mount a floppy disk [man]
# mount /dev/cdrom /mnt/cdrom mount a cdrom / dvdrom [man]
# mount /dev/hdc /mnt/cdrecorder mount a cdrw / dvdrom [man]
# mount /dev/hdb /mnt/cdrecorder mount a cdrw / dvdrom [man]
# mount -o loop file.iso /mnt/cdrom mount a file or iso image [man]
# mount -t vfat /dev/hda5 /mnt/hda5 mount a Windows FAT32 file system [man]
# mount /dev/sda1 /mnt/usbdisk mount a usb pen-drive or flash-drive [man]
# mount -t smbfs -o mount a windows network share [man]
username=user,password=pass
//WinClient/share /mnt/share
# umount /dev/hda2 unmount disk called hda2 - exit from mount
point '/ mnt/hda2' first [man]
# umount -n /mnt/hda2 run umount without writing the file /etc/mtab -
useful when the file is read-only or the hard
disk is full [man]
Command Description
# df -h show list of partitions mounted [man]
# dpkg-query -W -f='${Installed-Size;10}t$ show the used space by installed deb packages,
{Package}n' | sort -k1,1n sorting by size (debian, ubuntu and alike)
[man]
# du -sh dir1 estimate space used by directory 'dir1' [man]
# du -sk * | sort -rn show size of the files and directories sorted by
size [man]
# ls -lSr |more show size of the files and directories ordered by
size [man]
# rpm -q -a --qf '%10{SIZE}t%{NAME}n' | show the used space by rpm packages installed
sort -k1,1n sorted by size (fedora, redhat and alike) [man]
Command Description
# chage -E 2005-12-31 user1 set deadline for user password [man]
# groupadd [group] create a new group [man]
# groupdel [group] delete a group [man]
# groupmod -n moon sun rename a group from moon to sun [man]
# grpck check correct syntax and file format of
'/etc/group' and groups existence [man]
# newgrp - [group] log into a new group to change default group of
newly created files [man]
# passwd change password [man]
# passwd user1 change a user password (only by root) [man]
# pwck check correct syntax and file format of
'/etc/passwd' and users existence [man]
# useradd -c "User Linux" -g admin -d create a new user "user1" belongs "admin" group
/home/user1 -s /bin/bash user1 [man]
# useradd user1 create a new user [man]
# userdel -r user1 delete a user ( '-r' eliminates home directory)
[man]
# usermod -c "User FTP" -g system -d change user attributes as description, group and
/ftp/user1 -s /bin/nologin user1 other [man]