simple linux command

rm * : delete all files in your current directory.
rm *.html : delete all files ending in .html in your current directory.
ls -alR > result.txt : lists filenames + information in all subdirectories, and ouputs the results to a file instead of the screen.
ls -al /home/usr/bob/ : lists files + info for /home/usr/bob.
mkdir [directoryname] : creates a new directory.
rmdir [directoryname] : remove a directory if it is empty.
rm -r [directoryname] : remove a directory and all files in it.
mv [old name] [new name] : move/rename a file.
cp [filename] [new filename] : copy a file.
find / -name [filename] -print : search the whole server for a file.
find . -name [filename] -print : search for a file starting with the current directory.
sed s/[oldtext]/[newtext]/g [filename] : searches file and replaces all occurances of [oldtext] with [newtext].
cp -r [directoryname] [new directoryname] : copy a directory and all files/directories in it.
find / -name [directoryname] - type d -print : search the whole server for a direcory.
updatedb : Updates the locate database (locate database will update automatically every so often. This will force an update. You sometimes want to update the database manually after installing or moving software).
uname : Determines OS name, version and machine name.
vmstat : Lists information on memory usage.
vi : A text editor
whereis : Finds documentation files, source, and binary for a command.
who : Tells you who is logged into your server.
whoami : Tells you your user information.
alias : Allows you to set aliases and view the current aliases.
awk : Search for a pattern within a file.
alien : Converts .tgz and rpm's to .deb format.
banner : Prints characters as a poster.
badblocks : Searches a device for bad blocks.
biff : Turns mail notification on and off.


bg : Used to move a job running in the foreground to the background.
bzip2 : Used to compress and decompress files. Similar to gzip.
cardctl : Used to control PCMCIA cards.
cfdisk : Used to partition a hard disk.
chattr : Changes the attributes of a file or folder.
chroot : Change the root directory for a command.
chmod : Used to change permissions on a directory or file.
chown : Used to change the owner of a file or directory.
chgrp : Used to change the group a file belongs to.
clear : Clears the screen


cpio : Copies file archives from or to disks or tapes. Used for backing up.
cat : Displays the content of a file
chpasswd : Used to change a large number of passwords at once.
cd : Changes directories.
chage : Sets password aging parameters.
cal : Displays a calendar.


cron : Used to execute commands at a certain time.
crontab : Allows you to view or edit the current cron jobs.
dselect : A graphical front end for dpkg.
dpkg : Installs packages on debain distro's.
date : Prints current date to the screen
du : Lists disk usage in a directory.


df : Reports disk usage information. df -h will show you how much used/free space you have remaining in megabytes.
dmesg : Used to view the kernel boot file.
dump : Used for backing up.
edquota : Sets quotas for specific users.
env : Lists current environment variables.
fdisk : Used to create/edit/delete partitions.
fsck : Checks a file system for consistency.
fg : Used to send jobs to the background.



fuser : Checks to see what processes and users have open files.
free : Will show total memory, used memory, and free memory. -m will show it in megabytes instead of kilobytes
gcc : Used to compile C, Assembler, and Preprocessed C source files.
gpasswd : Used to set a password for a group.
grep : Used to search through a file for a specified pattern.
getty : Set terminal type, modes, speed, and line discipline
groupadd : Create new group account.
groupdel : Deletes a group.


groupmod : Used to modify a group.
groups : Shows what groups a user is part of.
gunzip : Uncompress files compressed by gzip.
head : Displays the first 10 lines of a file to the screen.
hdparm : Gets disk information.
history : Lists recently executed commands.
host : Used to get DNS info.


htpasswd : Allows you to set usernames and passwords for your websever.
id : Display information about yourself or another user.
insmod : Installs modules. To install a module, you would specify the path to the module.
init : Used to change run levels.
isapnp : Sets up ISA cards according to info found in the isapnp.conf file.
icmpinfo : Intercept and interpret ICMP packets


jobs : Used to show jobs running in the background.
join : Join lines of two sorted files by matching on a common field.
kill : Used to kill a process.
killall : Kill processes by command name.
kernelcfg : A graphical application that allows you to configure the kernel in X.
klogd : Control which kernel messages are displayed on the console; prioritize all messages, and log them through syslogd.
linuxconf : A command line GUI which lets you configure your linux box.
lpc : Used to control a line printer.


lpq : View the print spool queue.
lpr : Send files to the printer spool queue.
ln : Used to create hard and symbolic links.
less : Display the contents of a file
locate : Search for a file or directory (uses the locate database)
ldd : Shows what shared libraries a program is dependent on.
ldconfig : Used to configure/view shared libraries.
last : Lists logins and reboots.


lastlog : Print the last login times for system accounts.
lsmod : Lists loaded modules.
lsattr : Lists the attributes for a file or folder.
logrotate : Used to manipulate log files.
mount : Used by itself, reports the currently mounted files.
modinfo : Give info about the module.


modprobe : Queries modules.
man : Displays the Man page for a given command. Use it to find out more about a command such as syntx, arguments, and options. Example : man chmod
mesg : Used to allow/not allow 'write' messages to your terminal.
manpath : Attempts to determine the path to a man page.
mail : Used to send and receive mail.
mkdir : Make directory


mke2fs : Used to format a partition with the Ext2 file system.
merge : Merge multiple files together.
more : Lets you page through text one screen full at a time.
minicom : Great utility for troublshooting a modem.
mkbootdisk : Used to make a boot disk.


ntsysv : Used to select what services should automatically start.
nice : Used to set process priorities.
nslookup : Used to get DNS info from name servers.
netstat : Shows active sockets, print the protocol, the number of bytes waiting to be received, the number of bytes to be sent, the port number, the remote address and port, and the state of the socket.
ps : Displays current processes


ping : Used to test connectivity between two hosts.
pwconv : Used to set up the /etc/shadow file.
pnpdump : Determines settings for existing ISA cards.
quota : Allows users to view their own disk quotas.
quotaon : Turns on disk quotas for the system.
quotaoff : Turns off disk quotas for the system.


repquota : Provides reports of disk usage for various users.
rmmod : Removes modules. Just specify the name of the module you want removed like this- rmmod joystick
rpm : (RedHat flavors only)Used to install RPM's
rpcinfo : Used to see what rpc services are available on the machine.
route : Used to view/change routes between you and other hosts.


smbclient : Used to connect to Windows shares or Samba shares on a linux machine.
smbadduser : Maps linux user names to Windows NT user names.
smbpasswd : Used to update the smbpasswd file with new accounts.
set : Used to read and write variables.
setquota : Used to set disk quotas.


sort : Sorts lines in a file by alphabetical order.
sndconfig : Used to probe and configure a sound card.
su : Change to Super User (root).
spell : Checks for spelling errors in a file.
startx : Start the X Server (GUI)
shutdown : Shutdown machine


suspend : Places a shell in the background.
showmount : Shows mount information for an NFS server.
swapon : Turns on the swapfile.
swapoff : Turns off the swapfile.
testparm : Used to troubleshoot Samba.


tar : Used to compress multiple files/directories into one file. Also used to "untar".
timeconfig : Used to set the timezone on your machine.
tac : View a file from the last line up.
touch : Creates an empty file or updates access time for an existing file.
tail : Displays the last 10 lines of a file to the screen.
talk : Used to chat with another user on the same machine.


tr : Converts one set of characters to another.
traceroute : Used to track the path a packet takes to a host.
top : Shows information about the most CPU-intensive processes.
useradd : Add a user.
usermod : Modify a user.
userdel : Delete a user.
umount : Removes a device from the filesystem.




wc : Print the number of bytes, words, and lines in files
which : Finds the full path for a command.
write : Used to send a message to another user on the same machine.
whois : Used to query servers for info on domains and IP addresses.
wall : Writes a message to all logged in users.
xman : Graphical interface for man pages.
xf86config : Used to configure X.


zcat : Read files that have been compressed with gzip.
pwd : shows what your current directory is - giving the full path.
ls : Displays a directories contents.
ls -al : lists filenames + information.
ls -alR : lists filenames + information in all subdirectories.
ls -alR | more : lists filenames + information in all subdirectories, pausing : when the screen become full.
ls *.html : lists all files ending with .html.
ls -d */ : lists all directories within current directory.
rm [filename] : delete a file.

0 Response to "simple linux command"

Posting Komentar

powered by Blogger | WordPress by Newwpthemes | Converted by BloggerTheme