Linux commands

Page 1

Useful Commands for Redhat


Introduction The Linux Directory Layout File/Directory Basics File Viewing •File Compression •File Comparison •File Text Manipulation •Disks and File Systems •File Location •Backups and Remote Storage •Audio and Video •Hosts •Spelling Operations •Networking •Printing


The Linux Directory Layout Directory Description /bin

Essential command binaries (programs)are stored here(bash, ls, mount,tetc.)

/boot

Static files of the boot loader.

/dev

Device files. In Linux, hardware devices are acceessd just like other files, andthey are kept under this directory.

/etc

Host-specific system configuration files.

/home

Location of users' personal home directories (e.g. /home/Raj).

/lib

Essential shared libraries and kernel modules.


Directory

Description

/proc

Process information pseudo-filesystem. An interface to kernel data structures.

/root

The root (superuser) home directory.

/sbin

Essential system binaries (fdisk, fsck, init, etc).

/tmp

Temporary files. All users have permission to place temporary files here.

/usr

The base directory for most shareable, read-only data (programs, l ibraries,documentation, and much ore).

/usr/bin

Most user programs are kept here (cc, find, du, etc.).

/usr/include

Header files for compiling C programs.


Directory Description /usr/lib

Libraries for most binary programs.

/usr/sbin

Non-vital system binaries (lpd, useradd, etc.)

/usr/share

Architecture-independent data (icons, backgrounds, documentation, terminfo, man pages, etc.).

/usr/src

Program source code. E.g. The Linux Kernel, source RPMs, etc.

/usr/X11R6 The X Window System /var

Variable data: mail and printer spools, log files, lock files, etc.

/usr/local

“Locally� installed files. This directory only really matters in environments where files are stored on the network. Locallyinstalled files go in /usr/local/bin, /usr/local/lib, etc.). Also often used forsoftware packages installed from source,or software not officially shipped with the distribution.


X File/Directory Basics Command ls cp mv rm ln cd pwd mkdir rmdir

Task List files Copy files Rename files Delete files Link files Change directory Print current Create directory Delete directory


File Viewing Command

Task

cat less head tail nl od Xxd gv xdvi

View files Page through files View file beginning View ending of file Number lines of file View binary data of file View binary data with charecter View Postscript/PDF files View TeX DVI files


File Properties Command

Task

stat wc du file touch chown chgrp chmod chattr

Display file attributes Count bytes/words/lines Measure disk usage Identify file types /ASCII Files Create new file timestamps Change file owner Change file group Change file rotections/Permision Change advanced file attributes/ Special Characters List advanced file attributes

lsattr


File Compression Command

Task

gzip compress bzip2 zip

Compress files (GNU Zip) Compress files (Unix) Compress files (BZip2) Compress files (Windows Zip)


File Comparison Command

Task

diff comm cmp md5sum

Compare files line by line Compare sorted files Compare files byte by byte Compute checksums


File Text Manipulation Command

Task

grep cut paste tr sort uniq tee

Search text for matching lines Extract columns Append columns Translate characters Sort lines Locate identical lines Copy stdin to a file and to stdout simultaneously


Disks and File Systems Command

Task

df Dir. mount fsck sync

Show free disk space file & Make a disk accessible Check a disk for errors Flush disk caches


File Location Command

Task

find slocate which whereis

Locate files Locate files via index Locate commands Locate standard files


Backups and Remote Storage Command

Task

mt dump restore tar cdrecord rsync

Control a tape drive Back up a disk Restore a dump Read/write tape archives Burn a CD Mirror a set of files


Audio and Video Command

Task

grip xmms cdparanoia audacity xcdroast

Play CDs and rip MP3s Play audio files Rip audio Edit audio Burn CDs


Hosts Command

Task

uname hostname ifconfig host whois ping traceroute

Print system information Print the system’s hostname Set/display network information Look up DNS Look up domain registrants Check if host is reachable View network path to a host


Spelling Operations Command

Task

look aspell spell

Look up spelling Check spelling interactively Check spelling in batch


Networking Command

Task

ssh telnet scp sftp ftp evolution mutt mail

Securely log into remote hosts Log into remote hosts Securely copy files between hosts Securely files transfer between hosts Copy /Transfer files between hosts GUI email client Text-based email client Minimal email client


Command

Task

mozilla lynx wget slrn gaim talk write mesg

Web browser Text-only web browser Retrieve web pages to disk Read Usenet news Instant messaging/IRC Linux/Unix chat Send messages to a terminal Prohibit talk/write


Printing Command

Task

lpr lpq lprm

Print files View print queue Remove print jobs


THANK YOU


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.