Schedule a queue to run at 9am on March 1st. Note: Ctrl-d to save and exit.$ at 9am March 1
- Schedule a queue to run after 5 minutes.
$ at now +5 minutes
- Check any jobs pending to run, same as at -l .
$ atq
- Empty out a file.
$ cat /dev/null > /path/to/file
- Change directory, see also pushd and popd.
$ cd
- List run level information for the service type.
chkconfig --list
- Change owner recursively.
$ chown -R : /path/to/directory
- Change shell.
$ chsh
- Scan recursively for viruses.
clamscan -r
- Compare two files.
cmp file1 file2
- Copy keeping the directory structure.
$ cp --parent /source/path /destination/path
- Copy keeping the permissions of the user.
$ cp -p
- Copy recursive.
$ cp -r
- Copy without shell aliasing.
$ \cp
- List crontab for user.
$ crontab -u -l
- Check current date and time.
$ date
- Set current date and time, may need to set the hardware clock to the system time too, `man hwclock`.
$ date -s 'Wed May 28 11:35:00 EST 2003'
- Show disk free in human readable format.
$ df -h
- Configure interface using DHCP protocol.
$ dhclient eth0
- Find context differences between two files.
$ diff -c
- Creating a patch file.
$ diff -Naur oldDir/oldFile newDir/newFile > new_patchFile
- Kernel buffer
$ dmesg
- Show disk used in human readable format.
$ du -h /path/to/directory
- Find files larger than 10MB.
$ find /path/to/file -size +10000k
- Find file permissions with setuids.
find / \( -perm -4000 -o -perm -2000 \) -exec ls -ldb {} \;>> /tmp/suids
- Search for world writable files and directories.
$ find / -perm -002
- Display information on free and used memory.
$ free
- Grep on word boundaries.
grep -w
- Count the number of mathces - similar to “wc -l”.
$ grep -c
- Perform timings of device reads for benchmark and comparison purposes.
$ hdparm -t /dev/hda1
- Set the hardware clock to the current system time.
$ hwclock --systohc
- Configure network interface.
$ ifconfig
- Add an additional ip to eth0.
$ ifconfig eth0 xxx.xxx.xxx.xxx
- Install loadable kernel module. You can also use `modprobe` to do the same.
$ insmod
- Displays information about your system’s CPU and I/O.
$ iostat [ interval [ count ] ]
- List iptables firewall rules in numeric format.
$ iptables -L -n
- HangUP process so it will re-read the config file.
$ killall -HUP
- Install the boot loader and increase verborsity.
$ lilo -v -v
- Query the boot map.
$ lilo -q
- One time boot to the named kernel.
$ lilo -R
- Create symbolic link to the target file or directory.
$ ln -s
- Configure dynamic linker run-time bindings
$ ldconfig
- List the IPs bound via Ensim
$ listaliases
- Quickly search for indexed files. Run `updatedb` to update the indexed database.
$ locate
- List files.
$ ls
- List loaded kernel modules
$ lsmod
- Create the access.db file database map for sendmail.
$ makemap hash /etc/mail/access.db < /etc/mail/access
- Create/Make a new directory.
$ mkdir
- Generate a random 128 character length password.
$ mkpasswd -l 128
- Read in the contents of your mbox (or the specified file).
$ mail -f /var/mail/nameOfFile
- Print the mail queue
$ mailq
$ mailstat /path/to/procmail/log
- Description of the hierarchy directory structure of the system
$ man hier
- Check the MD5 message digest.
$ md5sum
- Mount points check.
$ mount
- Provide information about your systems’ processor.
$ mpstat [ interval [ count ] ]
$ ncftpget -R -u -p hostname /local_dir /remote_dir
$ netstat -a | grep -i listen
- Will show you who is attached to what port.
$ netstat -anpe
$ netstat -n
- See which programs are listening on which port
$ netstat -lnp
- Will show you what local TCP ports are open and what programs are running on them.
$ netstat -lntpe
- Will show you what local UDP ports are open and what programs are running on them.
$ netstat -lnupe
- Run a program with modified scheduling priority. (# range between -20 to +20, negative is higher prio
rity)$ nice -n # [command to nice]
- Scan network
$ nmap -v hostname/ip
- Patch and keep a backup
$ patch -p# -b < patch_file
$ ps -ecaux
- Turn off all quotas for users and groups, verbose mode
$ quotaoff -augv
- Check quota for all users and groups interactively, do quotaoff first.
$ quotacheck -augmiv
- Turn on all quotas for users and groups
$ quotaon -augv
- Add host ip to route on a particular device.
$ route add -host xxx.xxx.xxx.xxx dev eth0
$ rdate
$ rm
- Remove kernel module
$ rmmod
- Display the routing table in numeric.
$ route -n
$ rpm
- Uninstall/erase package.
$ rpm -e
- Erase without dependency check.
$ rpm -e --nodeps
- List out installed rpms by date, latest on top.
$ rpm -qa --last | less
- Rebuild rpm database.
$ rpm --rebuilddb
- Find which package owns the file.
$ rpm -qf /path/to/file $ rpm -q --whatprovides /path/to/file
- Verify package.
$ rpm -V
or
$ rpm -Vf /path/to/file
- Locate documentation for the package that owns the file.
$ rpm -qdf /path/to/file
- Query information on package.
$ rpm -qip
- Query files installed by package.
$ rpm -qlp
- Gives list of files that will be installed/overwritten.
$ rpm -ql
- Will show the scripts that will be executed.
$ rpm -q --scripts
- Display system activity information
$ sar
- Print a 0 padded sequence of numbers.
$ seq -w 1 10
- Record eveything printed on your terminal screen.
$ script -a
Ctrl+D to exit out. `more ` to view. - Check the status of a service.
$ service status
- Restart after shutdown and force fsck (fsck may take a while).
$ shutdown -rF now
- Split a file into pieces with numeric suffixes, so it can be burnt to cds.
$ split -d -b 640k big_input_filename.gz piece_file_prefix.gz.
To piece it back you can `cat piece_file_prefix.gz.* > original.gz` - Determine if a network service binary is linked againt tcp wrapper, libwrap.a
$ strings -f | grep hosts_access
$ tar
$ tar -cvzf fileName.tar.gz `find /file/path -mtime -1 ! -type d -print`
$ tar -xvzpf fileName.tar.gz /path/to/file.txt
$ tcpdump -i eth0 dst port 80 | more
$ top
- View the full command line.
$ top -c
$ touch
- Similar to `which` - shows full path to the command.
$ type
$ ulimit -a
$ uname
- Update package profile with rhn
$ up2date -p
- Install package via up2date.
$ up2date -i
$ uptime
$ usermod
- Utility reports virtual memory statistics
$ vmstat [second interval] [no. of count]
- Show who is logged on and what they are doing.
$ w
- Periodically watch output of a command in full screen
$ watch ''
$ webalizer -c /path/to/webalizer.conf
- Recursive download of a url, converting links, no parent.
$ wget -r -k -np
- Mirror, convert links, backup original, dynamic to html and output a “logFile”.
$ wget -m -k -K -E -o [logFile]
- Locate the binary, source, and manual page files for a command.
$ whereis
- Shows the full path of command.
$ which
- Show who is logged on.
$ who
- Yum package updates
$ yum check-update -- check to see what updates are needed $ yum info -- show basic information about a package $ yum update -- update particular package
- Control jobs:
$ Ctrl-z -- suspend foreground job $ jobs -- list jobs $ bg -- send job to background $ fg -- bring job to foreground
This Blog is intended to collect information of my various Intrests,pen my opinion on the information gathered and not intended to educate any one of the information posted,but are most welcome to share there view on them