I have found myself in the GUTL Wiki this complete list with more than 400 commands to GNU / Linux with their respective explanation, and I want to share them with you to complement this excellent article that my colleague wrote to learn how to live with the console.
System information
-
arch: show the architecture of the machine (1).
-
join me -m: show the architecture of the machine (2).
-
uname -r: show the version of the kernel used.
-
dmidecode -q: show the components (hardware) of the system.
-
hdparm -i / dev / hda: show the characteristics of a hard disk.
-
hdparm -tT / dev / sda: perform read test on a hard disk.
-
cat / proc / cpuinfo: show CPU information.
-
cat / proc / interrupts: show interruptions.
-
cat / proc / meminfo: check memory usage.
-
cat / proc / swaps: show swap files.
-
cat / proc / version: show the kernel version.
-
cat / proc / net / dev: show network adapters and statistics.
-
cat / proc / mounts: show mounted filesystem.
-
lspci-tv: show PCI devices.
-
lsusb -tv: show USB devices.
-
data: show the system date.
-
2011 cal: show the 2011 almanac.
-
07 cal 2011: show the almanac for the month July 2011.
-
dates 041217002011.00: set (declare, set) date and time.
-
clock-w: save date changes in BIOS.
Shutdown (Reboot System or Log Out)
-
shutdown-h now: turn off the system (1).
-
init 0: turn off the system (2).
-
telinit 0: turn off the system (3).
-
halt: turn off the system (4).
-
shutdown -h hours: minutes &- Planned system shutdown.
-
shutdown -c- Cancel a scheduled system shutdown.
-
shutdown -r now: restart (1).
-
reboot: restart (2).
-
logout: Sign off.
Files and Directories
-
cd / home: enter the "home" directory.
-
Cd ..: go back one level.
-
cd ../ ..: go back 2 levels.
-
CD: go to root directory.
-
cd ~ user1: go to the user1 directory.
-
cd -: go (return) to the previous directory.
-
pwd: show the path of the working directory.
-
ls: view the files in a directory.
-
ls -F: view the files in a directory.
-
Ls -l: show the details of files and folders in a directory.
-
ls -a: show hidden files.
-
ls * [0-9]*: show files and folders containing numbers.
-
tree: show files and folders as a tree starting from the root. (1)
-
lstree: show files and folders as a tree starting from the root. (2)
-
mkdir dir1: create a folder or directory named 'dir1'.
-
mkdir dir1 dir2: create two folders or directories simultaneously (Create two directories at the same time).
-
mkdir -p / tmp / dir1 / dir2: create a directory tree.
-
rm -f file1: delete the file named 'file1'.
-
rmdir dir1: delete the folder named 'dir1'.
-
rm -rf dir1: delete a folder named 'dir1' with its contents recursively. (If I delete it recursively I am saying that it is with its content).
-
rm -rf dir1 dir2: delete two folders (directories) with their content recursively.
-
mv dir1 new_dir: rename or move a file or folder (directory).
-
zip file1: copy a file.
-
cp file1 file2: copy two files in unison.
-
cp dir / *.: copy all files from a directory into the current working directory.
-
cp -a / tmp / dir1.: copy a directory within the current working directory.
-
cp -a dir1: copy a directory.
-
cp -a dir1 dir2: copy two directories in unison.
-
ln -s file1 LNK1: create a symbolic link to the file or directory.
-
ln file1 lnk1: create a physical link to the file or directory.
-
touch -t 0712250000 file1: modify the real time (creation time) of a file or directory.
-
file file1: output (dump on screen) of the mime type of a text file.
-
iconv -l: lists of known ciphers.
-
iconv -f fromEncoding -t toEncoding inputFile> outputFile: create a new form of the input file assuming it is encoded in fromEncoding and converting it to ToEncoding.
-
find. -maxdepth 1 -name * .jpg -print -exec convert ”{}” -resize 80 × 60 “thumbs / {}” \;: group resized files in the current directory and send them to directories in thumbnail views (requires converting from ImagemagicK).
Find files
-
find / -name file1: search for file and directory starting from the root of the system.
-
find / -user user1: search for files and directories belonging to user 'user1'.
-
find / home / user1 -name \ *. bin: search for files with extension '. bin 'inside the directory' / home / user1 '.
-
find / usr / bin -type f -atime +100: find binary files not used in the last 100 days.
-
find / usr / bin -type f -mtime -10: search for files created or changed within the last 10 days.
-
find / -name \ *. rpm -exec chmod 755 '{}' \;: search for files with '.rpm' extension and modify permissions.
-
find / -xdev -name \ *. rpm: Search for files with '.rpm' extension ignoring removable devices such as cdrom, pen-drive, etc. ...
-
locate \ *. ps: find files with extension '.ps' first executed with command 'updatedb'.
-
where's halt: show the location of a binary, help or source file. In this case it asks where the 'halt' command is.
-
which stops: show the full path (the entire path) to a binary / executable.
Mounting a filesystem
-
mount / dev / hda2 / mnt / hda2: mount a disk named hda2. Check first the existence of the directory '/ mnt / hda2'; if it is not, you must create it.
-
umount / dev / hda2: unmount a disk named hda2. First exit from point '/ mnt / hda2.
-
fuser -km / mnt / hda2- Force unmount when device is busy.
-
umount -n / mnt / hda2: run the unmount without reading the / etc / mtab. Useful when the file is read-only or the hard drive is full.
-
mount / dev / fd0 / mnt / floppy: mount a floppy disk.
-
mount / dev / cdrom / mnt / cdrom: mount a cdrom / dvdrom.
-
mount / dev / hdc / mnt / cdrecorder: mount a rewritable cd or dvdrom.
-
mount / dev / hdb / mnt / cdrecorder: mount a rewritable cd / dvdrom (a dvd).
-
mount -o loop file.iso / mnt / cdrom: mount a file or iso image.
-
mount -t vfat / dev / hda5 / mnt / hda5: mount a FAT32 filesystem.
-
mount / dev / sda1 / mnt / usbdisk: mount a usb pen-drive or memory (without specifying the type of filesystem).
Disk space
-
df -h: display a list of mounted partitions.
-
ls -lSr | more: show the size of the files and directories ordered by size.
-
du -sh dir1: Estimate the space used by the directory 'dir1'.
-
du sk * | sort -rn: show the size of the files and directories ordered by size.
-
rpm -q -a –qf '% 10 {SIZE} t% {NAME} n' | sort -k1,1n: show the space used by the installed rpm packages organized by size (Fedora, Redhat and others).
-
dpkg-query -W -f = '$ {Installed-Size; 10} t $ {Package} n' | sort -k1,1n: show the space used by installed packages, organized by size (Ubuntu, Debian and others).
Users and Groups
-
groupadd group_name: create a new group.
-
groupdel group_name: delete a group.
-
groupmod -n new_group_name old_group_name: rename a group.
-
useradd -c “Name Surname” -g admin -d / home / user1 -s / bin / bash user1: Create a new user belonging to the group "admin".
-
user add user1: create a new user.
-
userdel -r user1: delete a user ('-r' removes the Home directory).
-
usermod -c "User FTP”-G system -d / ftp / user1 -s / bin / nologin user1: change user attributes.
-
Passwd: change Password.
-
password user1: change a user's password (root only).
-
change -E 2011-12-31 user1: set a term for the user's password. In this case it says that the key expires on December 31, 2011.
-
pwck: check the correct syntax the file format of '/ etc / passwd' and the existence of users.
-
grpck: check the correct syntax and format of the file '/ etc / group' and the existence of groups.
-
newgrp group_name: Register a new group to change the default group of newly created files.
Permissions in Files (Use "+" to place permissions and "-" to remove)
-
ls -lh: Show permissions.
-
ls / tmp | pr -T5 -W $ COLUMNS: divide the terminal into 5 columns.
-
chmod ugo + rwx directory1: place read ®, write (w) and execute (x) permissions to owner (u), group (g) and others (o) on directory 'directory1'.
-
chmod go-rwx directory1: remove read permission ®, write (w) and (x) execute to group (g) and others (o) on directory 'directory1'.
-
chown user1 file1: change the owner of a file.
-
chown -R user1 directory1: change the owner of a directory and of all files and directories contained within.
-
chgrp group1 file1: change group of files.
-
chown user1: group1 file1: change user and group that owns a file.
-
find / -perm -u + s: view all files on the system with SUID configured.
-
chmod u + s / bin / file1: put the SUID bit in a binary file. The user running that file acquires the same privileges as the owner.
-
chmod us / bin / file1: disable the SUID bit in a binary file.
-
chmod g + s / home / public: put an SGID bit in a directory –similar to SUID but per directory.
-
chmod gs / home / public: disable an SGID bit in a directory.
-
chmod o + t / home / public: put a STIKY bit in a directory. Allows file deletion only to legitimate owners.
-
chmod ot / home / public: disable a STIKY bit in a directory.
Special attributes in files (Use "+" to set permissions and "-" to remove)
-
chattr + to file1: allows writing by opening a file only append mode.
-
chattr + c file1: allows a file to be compressed / decompressed automatically.
-
chattr + d file1: ensures that the program ignores deleting files during backup.
-
chattr + i file1: makes the file invariable, so it cannot be deleted, altered, renamed, or linked.
-
chattr + s file1: allows a file to be safely deleted.
-
chattr + S file1: ensures that a file is modified, changes are written in synchronous mode as with sync.
-
chattr + u file1: allows you to recover the content of a file even if it is canceled.
-
lsattr: show special attributes.
Archives and compressed files
-
bunzip2 file1.bz2: unzip a file named 'file1.bz2'.
-
bzip2 file1: compress a file named 'file1'.
-
Gunzip File1.gz: unzip a file called 'file1.gz'.
-
gzip file1: compress a file named 'file1'.
-
gzip -9 file1: compresses with maximum compression.
-
rar to file1.rar test_file: create a rar file called 'file1.rar'.
-
rar to file1.rar file1 file2 dir1: compress 'file1', 'file2' and 'dir1' simultaneously.
-
rar x file1.rar: unzip rar file.
-
UNRAR X FILE1.RAR: unzip rar file.
-
tar -cvf archive.tar file1: create an unzipped tarball.
-
tar -cvf archive.tar file1 file2 dir1: create a file containing 'file1', 'file2' and 'dir1'.
-
tar tf archive.tar: display the contents of a file.
-
tar -xvf archive.tar: extract a tarball.
-
tar -xvf archive.tar -C / tmp: extract a tarball in / tmp.
-
tar -cvfj archive.tar.bz2 dir1: create a compressed tarball inside bzip2.
-
-xvfj tar archive.tar.bz2: decompress a tar archive compressed in bzip2
-
tar -cvfz archive.tar.gz dir1: create a gzipped tarball.
-
tar -xvfz archive.tar.gz- Unzip a gzipped tar archive.
-
zip file1.zip file1: create a compressed zip file.
-
zip -r file1.zip file1 file2 dir1: compress, in zip, several files and directories simultaneously.
-
unzip file1.zip: unzip a zip file.
RPM packages (Red Hat, Fedora, and the like)
-
rpm ivh package.rpm: install an rpm package.
-
rpm -ivh –nodeeps package.rpm: install an rpm package ignoring dependency requests.
-
rpm -U package.rpm: update a rpm package without changing the configuration of the files.
-
rpm -F package.rpm: update an rpm package only if it is installed.
-
rpm -e package_name.rpm: remove a rpm package.
-
rpm -qa: show all rpm packages installed on the system.
-
rpm -qa | grep httpd: show all rpm packages with the name "httpd".
-
rpm -qi package_name- Get information on a specific installed package.
-
rpm -qg "System Environment / Daemons": show rpm packages of a software group.
-
rpm -ql package_name: show list of files given by an installed rpm package.
-
rpm -qc package_name: show configuration list of files given by an installed rpm package.
-
rpm -q package_name --whatrequires: show requested list of dependencies for an rpm package.
-
rpm -q package_name -whatprovides: show the capacity given by an rpm package.
-
rpm -q package_name --scripts: show scripts started during installation / removal.
-
rpm -q package_name --changelog: show the revision history of an rpm package.
-
rpm -qf /etc/httpd/conf/httpd.conf: check which rpm package belongs to a given file.
-
rpm -qp package.rpm -l: show list of files given by a rpm package that has not yet been installed.
-
rpm –import / media / cdrom / RPM-GPG-KEY: import the digital signature of the public key.
-
rpm –checksig package.rpm: verify the integrity of an rpm package.
-
RPM -QA GPG -Pubkey- Check the integrity of all installed rpm packages.
-
rpm -V package_name: check file size, licenses, types, owner, group, MD5 summary check and last modification.
-
rpm -Va: check all rpm packages installed on the system. Use with care.
-
Vp rpm package.rpm: check an rpm package not installed yet.
-
rpm2cpio package.rpm | cpio –extract –make-directories * bin*: extract executable file from rpm package.
-
rpm -ivh /usr/src/redhat/RPMS/`arch`/package.rpm: install a package built from an rpm source.
-
rpmbuild –rebuild package_name.src.rpm: build a rpm package from a rpm source.
YUM Package Updater (Red Hat, Fedora and the like)
-
yum install package_name: download and install an rpm package.
-
yum localinstall package_name.rpm: this will install an RPM and try to resolve all dependencies for you, using your repositories.
-
yum update package_name.rpm: update all rpm packages installed on the system.
-
yum update package_name: modernize / update an rpm package.
-
yum remove package_name: remove a rpm package.
-
yum list: list all packages installed on the system.
-
yum search package_name: Find a package in rpm repository.
-
yum clean packages: clear an rpm cache by deleting downloaded packages.
-
yum clean headers: remove all header files that the system uses to resolve the dependency.
-
yum clean all: remove from cache packets and header files.
Deb packages (Debian, Ubuntu and derivatives)
-
dpkg -i package.deb: install / update a deb package.
-
dpkg -r package_name: remove a deb package from the system.
-
dpkg -l: show all deb packages installed on the system.
-
dpkg -l | grep httpd: show all deb packages with the name "httpd"
-
dpkg -s package_name- Get information on a specific package installed on the system.
-
dpkg -L package_name: show list of files given by a package installed on the system.
-
dpkg -contents package.deb: show list of files given by a package not installed yet.
-
dpkg -S / bin / ping: check which package belongs to a given file.
APT Package Updater (Debian, Ubuntu and derivatives)
-
apt-get install package_name: install / update a deb package.
-
apt-cdrom install package_name: install / update a deb package from a cdrom.
-
apt-get update: update package list.
-
apt-get upgrade: update all installed packages.
-
apt-get remove package_name: remove a deb package from the system.
-
apt get check: verify the correct resolution of the dependencies.
-
apt-get clean: clear cache from downloaded packages.
-
apt-cache search searched-package: returns a list of packages corresponding to the series "searched packages".
View the content of a file
-
cat file1: view the contents of a file starting from the first row.
-
tock file1: view the contents of a file starting from the last line.
-
more file1: view the content throughout a file.
-
less file1: similar to the 'more' command but allows saving the movement in the file as well as the movement backwards.
-
head -2 file1: see the first two lines of a file.
-
tail -2 file1: see the last two lines of a file.
-
tail -f / var / log / messages: see in real time what has been added to the file.
Text manipulation
-
cat file1 file2 .. | command <> file1_in.txt_or_file1_out.txt- General syntax for manipulating text using PIPE, STDIN, and STDOUT.
-
cat file1 | command (sed, grep, awk, grep, etc ...)> result.txt: general syntax to manipulate a text in a file and write the result in a new file.
-
cat file1 | command (sed, grep, awk, grep, etc ...) »result.txt: general syntax to manipulate a text in a file and add results to an existing file.
-
grep Aug / var / log / messages: search for words “Aug” in the file '/ var / log / messages'.
-
grep ^ Aug / var / log / messages: find words starting with “Aug” in file '/ var / log / messages'
-
grep [0-9] / var / log / messages: select all lines in the file '/ var / log / messages' that contain numbers.
-
grep Aug -R / var / log /*: look for the string “Aug” in the directory '/ var / log' and below.
-
sed 's / stringa1 / stringa2 / g' example.txt: relocate "string1" with "string2" in example.txt
-
sed '/ ^ $ / d' example.txt: remove all blank lines from example.txt
-
sed '/ * # / d; / ^ $ / d 'example.txt: remove comments and blank lines from example.txt
-
echo 'esempio' | tr '[: lower:]' '[: upper:]': convert lowercase to uppercase.
-
sed -e '1d' result.txt: remove the first line of the file example.txt
-
sed -n '/ stringa1 / p': display only the lines that contain the word "string1".
Set character and file conversion
-
dos2unix filesos.txt fileunix.txt: convert a text file format from MSDOS to UNIX.
-
unix2dos fileunix.txt files.txt: convert a text file format from UNIX to MSDOS.
-
recode..HTML <page.txt> page.html: convert a text file into html.
-
recode -l | more- Show all available format conversions.
File system analysis
-
badblocks -v / dev / hda1: Check bad blocks on disk hda1.
-
fsck / dev / hda1: repair / check the integrity of the Linux system file on disk hda1.
-
fsck.ext2 / dev / hda1: repair / check integrity of ext 2 system file on disk hda1.
-
e2fsck / dev / hda1: repair / check integrity of ext 2 system file on disk hda1.
-
e2fsck -j / dev / hda1: repair / check integrity of ext 3 system file on disk hda1.
-
fsck.ext3 / dev / hda1: repair / check integrity of ext 3 system file on disk hda1.
-
fsck.vfat / dev / hda1: repair / check the integrity of the fat system file on disk hda1.
-
fsck.msdos / dev / hda1: repair / check the integrity of a file on system dos on disk hda1.
-
dosfsck / dev / hda1: repair / check the integrity of a file on system dos on disk hda1.
Format a filesystem
-
mkfs / dev / hda1: create a Linux-like system file on partition hda1.
-
mke2fs / dev / hda1: create a Linux ext 2 system file on hda1.
-
mke2fs -j / dev / hda1: create a Linux ext3 (periodic) system file on partition hda1.
-
mkfs -t vfat 32 -F / dev / hda1: create a FAT32 system file on hda1.
-
fdformat -n / dev / fd0: format a flooply disk.
-
mkswap / dev / hda3: create a swap system file.
I work with the SWAP
-
mkswap / dev / hda3: create swap system file.
-
swapon / dev / hda3: activating a new swap partition.
-
swapon / dev / hda2 / dev / hdb3: activate two swap partitions.
Saves (Backup)
-
dump -0aj -f /tmp/home0.bak / home: make a full save of the '/ home' directory.
-
dump -1aj -f /tmp/home0.bak / home: make an incremental save of the '/ home' directory.
-
restore -if /tmp/home0.bak: restoring a salvo interactively.
-
rsync -rogpav –delete / home / tmp: synchronization between directories.
-
rsync -rogpav -e ssh –delete / home ip_address: / tmp: rsync through tunnel SSH.
-
rsync -az -e ssh –delete ip_addr: / home / public / home / local- Synchronize a local directory with a remote directory via ssh and compression.
-
rsync -az -e ssh –delete / home / local ip_addr: / home / public- Synchronize a remote directory with a local directory via ssh and compression.
-
dd bs = 1M if = / dev / hda | gzip | ssh user @ ip_addr 'dd of = hda.gz': save a hard drive on a remote host via ssh.
-
dd if = / dev / sda of = / tmp / file1: save the contents of a hard disk to a file. (In this case the hard disk is "sda" and the file is "file1").
-
tar -Puf backup.tar / home / user: make an incremental save of the directory '/ home / user'.
-
(cd / tmp / local / && tar c.) | ssh -C user @ ip_addr 'cd / home / share / && tar x -p': copy the contents of a directory to a remote directory via ssh.
-
(tar c / home) | ssh -C user @ ip_addr 'cd / home / backup-home && tar x -p': copy a local directory to a remote directory via ssh.
-
tar cf -. | (cd / tmp / backup; tar xf -): local copy preserving licenses and links from one directory to another.
-
find / home / user1 -name '* .txt' | xargs cp -av –target-directory = / home / backup / –parents: find and copy all files with extension '.txt' from one directory to another.
-
find / var / log -name '* .log' | tar cv –files-from = - | bzip2> log.tar.bz2: find all files with the extension '.log' and make a bzip archive.
-
dd if = / dev / hda of = / dev / fd0 bs = 512 count = 1: make a copy of the MRB (Master Boot Record) to a floppy disk.
-
dd if = / dev / fd0 of = / dev / hda bs = 512 count = 1: restore the copy of the MBR (Master Boot Record) saved on a floppy.
CD-ROM
-
cdrecord -v gracetime = 2 dev = / dev / cdrom -eject blank = fast -force: clean or erase a rewritable cd.
-
mkisofs / dev / cdrom> cd.iso: create an iso image of cdrom on disk.
-
mkisofs / dev / cdrom | gzip> cd_iso.gz: create a compressed iso image of cdrom on disk.
-
mkisofs -J -allow-leading-dots -R -V "Label CD" -iso-level 4 -o ./cd.iso data_cd: create an iso image of a directory.
-
cdrecord -v dev = / dev / cdrom cd.iso: burn an iso image.
-
gzip -dc cd_iso.gz | cdrecord dev = / dev / cdrom -: burn a compressed iso image.
-
mount -o loop cd.iso / mnt / iso: mount an iso image.
-
cd-paranoia -B: take songs from a cd to wav files.
-
cd-paranoia - "-3": transfer the first 3 songs from a cd to wav files.
-
Cdrecord –Scanbus: scan bus to identify scsi channel.
-
dd if = / dev / hdc | md5sum: run an md5sum on a device, such as a CD.
I work with the NETWORK ( LAN and Wi-Fi)
-
ifconfig eth0: show the configuration of an Ethernet network card.
-
ifup eth0: activate an interface 'eth0'.
-
ifdown eth0: disable an interface 'eth0'.
-
ifconfig eth0 192.168.1.1 netmask 255.255.255.0: configure an IP address.
-
ifconfig eth0 promisc: configure 'eth0' in common mode to obtain packets (sniffing).
-
dhclient eth0: activate interface 'eth0' in dhcp mode.
-
route: show tour table.
-
route add -net 0/0 gw IP_Gateway: set default input.
-
route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1: configure static route to search the network '192.168.0.0/16'.
-
route 0/0 gw IP_gateway: remove the static route.
-
echo "1"> / proc / sys / net / ipv4 / ip_forward: activate ip tour.
-
hostname: display the hostname of the system.
-
host www.example.com: find the host name to resolve the name to an ip address (1).
-
nslookup www.example.com: find the host name to resolve the name to an ip address and vice versa (2).
-
ip link show: show link status of all interfaces.
-
mii-tool eth0: show link status of 'eth0'.
-
ethtool eth0: show the statistics of network card 'eth0'.
-
netstat-tup- Show all active network connections and their PIDs.
-
netstat-tupl: show all network listeners on the system and their PIDs.
-
tcp dump tcp port 80: show all traffic HTTP.
-
iwlist scan: show wireless networks.
-
iwconfig eth1: show the configuration of a wireless network card.
-
whois www.example.com: search the Whois database.
Microsoft Windows Networks (SAMBA)
-
nbtscan ip_addr: bios network name resolution.
-
nmblookup -A ip_addr: bios network name resolution.
-
smbclient -L ip_addr / hostname: show remote actions of a host in windows.
IP tables (FIREPLACES)
-
iptables -t filter -L: show all strings in the filter table.
-
iptables -t nat -L: show all strings from nat table.
-
iptables -t filter -F: clear all rules from filter table.
-
iptables -t nat -F: clear all rules from nat table.
-
iptables -t filter -X: delete any string created by the user.
-
iptables -t filter -A INPUT -p tcp telnet -j ACCEPT -dport: allow telnet connections to enter.
-
iptables -t filter -A OUTPUT -p tcp -dport http -j DROP: block connections HTTP to go out.
-
iptables -t filter -A FORWARD -p tcp –dport pop3 -j ACCEPT: allow connections POP to a front chain.
-
iptables -t filter -A INPUT -j LOG --log-prefix “DROP INPUT”: registering an input string.
-
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE: configure a PAT (Address Translation Port) on eth0, hiding the force-out packets.
-
iptables -t nat -A PREROUTING -d 192.168.0.1 -p tcp -m tcp –dport 22 -j DNAT –to-destination 10.0.0.2:22: redirect packets directed from one host to another.
Monitoring and debugging
-
top: show linux tasks using most cpu.
-
ps-eafw: shows Linux tasks.
-
ps -e -o pid, args –forest- Displays Linux tasks in a hierarchical mode.
-
ptree: show a process system tree.
-
kill -9 Process_ID- Force close a process and terminate it.
-
kill -1 Process_ID: force a process to reload the configuration.
-
lsof -p $$: show a list of files opened by processes.
-
lsof / home / user1: shows a list of open files in a given path of the system.
-
strace -c ls> / dev / null: show the system calls made and received by a process.
-
strace -f -e open ls> / dev / null: show the calls to the library.
-
watch -n1 'cat / proc / interrupts': show interruptions in real time.
-
last reboot: show reboot history.
-
lsmod: show the loaded kernel.
-
free -m- Displays the status of RAM in megabytes.
-
smartctl -A / dev / hda- Monitor the reliability of a hard drive through SMART.
-
smartctl -i / dev / hda: check if SMART is enabled on a hard disk.
-
tail / var / log / dmesg: show events inherent to the kernel loading process.
-
tail / var / log / messages: show system events.
Other useful commands
-
apropos ... keyword: show a list of commands that belong to the keywords of a program; They are useful when you know what your program does, but you do not know the name of the command.
-
manping: show the manual pages online; for example, in a ping command, use the '-k' option to find any related command.
-
whatis… keyword: shows the description of what the program does.
-
mkbootdisk –device / dev / fd0 `uname -r`: create a potable floppy.
-
gpg -c file1: encode a file with GNU security guard.
-
gpg file1.gpg: decode a file with GNU Security Guard.
-
wget -r www.example.com: download a complete website.
-
wget -c www.example.com/file.iso: download a file with the possibility of stopping the download and resuming later.
-
echo 'wget -c www.example.com/files.iso'| at 09:00: Start a download at any time. In this case it would start at 9 o'clock.
-
ldd / usr / bin / ssh: show the shared libraries required by the ssh program.
-
alias hh = 'history': place an alias for a command –hh = History.
-
chsh: change the Shell command.
-
chsh --list-shells: is a suitable command to know if you have to do remote in another terminal.
-
WHO -a: show who is registered, and print time of the last import system, dead processes, system registry processes, active processes produced by init, current operation and last changes of the system clock.