Some Useful Linux Commands

Below are some useful Linux commands. These are very useful in day to day Administration life.

Schedule a queue to run at 9am on March 1st. Note: Ctrl-d to save and exit.

Schedule a queue to run after 5 minutes.

Check any jobs pending to run, same as at -l .

Empty out a file.

Change directory, see also pushd and popd.

List run level information

Change owner recursively.

Change shell.

Scan recursively for viruses.

Compare two files.

Copy keeping the directory structure.

Copy keeping the permissions of the user.

Copy recursive.

Copy without shell aliasing.

List crontab for user.

Check current date and time.

Set current date and time, may need to set the hardware clock to the system time too, man hwclock.

Show disk free in human readable format.

Configure interface using DHCP protocol.

Find context differences between two files.

Creating a patch file.

Kernel buffer

Show disk used in human readable format.

Find files larger than 10MB.

Find file permissions with setuids.

Search for world writable files and directories.

Display information on free and used memory.

Grep on word boundaries.

Count the number of mathces . similar to .wc -l..

Perform timings of device reads for benchmark and comparison purposes.

Set the hardware clock to the current system time.

check the ip address

Add an ip address to eth0.

Install loadable kernel module. You can also use modprobe to do the same.

Displays information about your system.s CPU and I/O.

List iptables firewall rules in numeric format.

HangUP process so it will re-read the config file.

Install the boot loader and increase verborsity.

Query the boot map.

One time boot to the named kernel.

Create symbolic link to the target file or directory.

Configure dynamic linker run-time bindings

List the IPs bound via Ensim

Quickly search for indexed files. Run updatedb to update the indexed database.

List files.

List loaded kernel modules

Create the access.db file database map for sendmail.

Create/Make a new directory.

Generate a random 128 character length password.

Read in the contents of your mbox (or the specified file).

Print the mail queue

Description of the hierarchy directory structure of the system

Check the MD5 message digest.

Mount points check.

Provide information about your systems. processor.

Will show you who is attached to what port.

See which programs are listening on which port

Will show you what local TCP ports are open and what programs are running on them.

Will show you what local UDP ports are open and what programs are running on them.

Run a program with modified scheduling priority. (# range between -20 to +20, negative is higher priority)

Scan network

Patch and keep a backup

Turn off all quotas for users and groups, verbose mode

Check quota for all users and groups interactively, do quotaoff first.

Turn on all quotas for users and groups

Add host ip to route on a particular device.

Remove file

Remove kernel module

Display the routing table in numeric.

Uninstall/erase package.

Erase without dependency check.

List out installed rpms by date, latest on top.

Rebuild rpm database.

Find which package owns the file.

Verify package.

Locate documentation for the package that owns the file.

Query information on package.

Query files installed by package.

Gives list of files that will be installed/overwritten.

Will show the scripts that will be executed.

Display system activity information

Print a 0 padded sequence of numbers.

Record eveything printed on your terminal screen.

Ctrl+D to exit out. more to view.

Check the status of a service.

Restart after shutdown and force fsck (fsck may take a while).

Split a file into pieces with numeric suffixes, so it can be burnt to cds.

To piece it back you can

Determine if a network service binary is linked againt tcp wrapper, libwrap.a

How to use tcpdump

System process status

View the full command line.

Create empty file of 0 byte

Similar to which . shows full path to the command.

Check the limit of user

Check the version of kernel running

Update package profile with rhn

Install package via up2date.

Show the system uptime information

Modify User information

Utility reports virtual memory statistics

Show who is logged on and what they are doing.

Periodically watch output of a command in full screen

Run and generate the apache reports using webalizer

Recursive download of a url, converting links, no parent.

Mirror, convert links, backup original, dynamic to html and output a .logFile..

Locate the binary, source, and manual page files for a command.

Shows the full path of command.

Show who is logged on.

Yum package updates

Control jobs:

 

The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

Leave a Reply