0% found this document useful (0 votes)
5 views10 pages

Comandos Linux

The document provides a structured reference guide to Linux commands, categorized into 15 sections for easier understanding. It includes commands related to system information, hardware, statistics, user management, file operations, process management, file permissions, networking, and more. The guide is suitable for both advanced and new Linux users and is available in PDF format for download.

Uploaded by

MrBushido
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views10 pages

Comandos Linux

The document provides a structured reference guide to Linux commands, categorized into 15 sections for easier understanding. It includes commands related to system information, hardware, statistics, user management, file operations, process management, file permissions, networking, and more. The guide is suitable for both advanced and new Linux users and is available in PDF format for download.

Uploaded by

MrBushido
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Linux Commands In Structured Order with Detail... [Link]

html

HOME (HTTP://[Link]/) NEWS (HTTP://[Link]/CATEGORY/NEWS/)

OPENSOURCE (HTTP://[Link]/CATEGORY/OPENSOURCE/) HOWTOS (HTTP://[Link]/CATEGORY/HOW-TOS/)

LINUX HOWTO (HTTP://[Link]/CATEGORY/LINUX-HOW-TO/) ABOUT (HTTP://[Link]/ABOUT/)

CONTACT US (HTTP://[Link]/CONTACT-US/)

Linux Commands In Structured Order with


Detailed Reference
SYSTEM
April 26, 2013 | By NixSavy ([Link]
HARDWARE
Linux command shelf is a quick reference guide for all linux
user who wish to learn linux commands. Commands are STATISTICS
divided into 15 categories , which would be more easier to
USERS
understand what commands to be used in specific
requirement. The pdf format of linux command shelf is also FILE COMMANDS
available. You could reach Bobbin Zachariah
PROCESS RELATED
([Link] the
author of this guide for any comments or corrections. FILE PERMISSION RELATED

You can download the latest version of linux command shelf NETWORK
([Link]
COMPRESSION / ARCHIVES
/doc/linux_command_shelf_pdf_ver1_1.pdf) in pdf format.
Current linux command shelf version is 1.1. This guide can INSTALL PACKAGE
be used by both advanaced and new linux users , provided
SEARCH
the best efforts to give most relevant linux commands.
LOGIN (SSH AND TELNET)
You can navigate to each section using the index that is places on the right hand side of this
page or just below. If you feel hard to understand any command please let me know on my FILE TRANSFER
above profile page.
DISK USAGE

DIRECTORY TRAVERSE

Find us on Facebook
1. SYSTEM
2. HARDWARE Linoxide
3. STATISTICS Like
4. USERS
5. FILE COMMANDS 13,798 people like Linoxide.
6. PROCESS RELATED
7. FILE PERMISSION RELATED
8. NETWORK
9. COMPRESSION / ARCHIVES
10. INSTALL PACKAGE
11. SEARCH
12. LOGIN (SSH AND TELNET)
Facebook social plugin
13. FILE TRANSFER
1 de14.
10 DISK USAGE 04/04/14 10:38
15. DIRECTORY TRAVERSE
Linux Commands In Structured Order with Detail... [Link]
1. SYSTEM

$ uname –a => Display linux system information


$ uname –r => Display kernel release information
(refer uname command in detail ([Link]
me-command/))
$ cat /etc/redhat_release => Show which version of redhat insta
lled
$ uptime => Show how long system running + loa
d (learn uptime command ([Link]
e-command/))
$ hostname => Show system host name
$ hostname -i => Display the IP address of the host
(all options hostname ([Link]
hostname-linux/))
$ last reboot => Show system reboot history (more e
xamples last command ([Link]
mand/))
$ date => Show the current date and time (op
tions of date command ([Link]
linux/))
$ cal => Show this month calendar (what mor
e in cal ([Link]
calender-linux/))
$ w => Display who is online (learn more
about w command ([Link]
$ whoami => Who you are logged in as (example
+ sreenshots ([Link]
)
$ finger user => Display information about user (ma
ny options of finger command ([Link]
-command-user-details/))

2. HARDWARE

2 de 10 04/04/14 10:38
Linux $Commands
dmesg In Structured Order=>with Detail...
Detected hardware [Link]
and boot message
s (dmesg many more options ([Link]
esg-command/))
$ cat /proc/cpuinfo => CPU model
$ cat /proc/meminfo => Hardware memory
$ cat /proc/interrupts => Lists the number of interrupts per
CPU per I/O device
$ lshw => Displays information on hardware c
onfiguration of the system
$ lsblk => Displays block device related info
rmation in Linux (sudo yum install util-linux-ng)
$ free -m => Used and free memory (-m for MB) (
free command in detail ([Link]
ommand/))
$ lspci -tv => Show PCI devices (very useful to f
ind vendor ids ([Link]
$ lsusb -tv => Show USB devices (read more lsusb
options ([Link]
sb/))
$ lshal => Show a list of all devices with th
eir properties
$ dmidecode => Show hardware info from the BIOS (
vendor details ([Link]
m-hardware-information-in-bios/))
$ hdparm -i /dev/sda # Show info about disk sda
$ hdparm -tT /dev/sda # Do a read speed test on disk sda
$ badblocks -s /dev/sda # Test for unreadable blocks on disk
sda

3. STATISTICS

3 de 10 04/04/14 10:38
Linux $Commands
top In Structured Order with Detail...
=> Display and [Link]
update the top cpu p
rocesses (30 example options ([Link]
top-command-examples-screenshots/))
$ mpstat 1 => Display processors related stati
stics (learn mpstat command ([Link]
pstat-command/))
$ vmstat 2 => Display virtual memory statistic
s (very useful performance tool ([Link]
ux-vmstat-command-tool-report-virtual-memory-statistics/))
$ iostat 2 => Display I/O statistics (2sec Int
ervals) (more examples ([Link]
-command/))
$ tail -n 500 /var/log/messages => Last 10 kernel/syslog messages (
everyday use tail options ([Link]
l-command/))
$ tcpdump -i eth1 => Capture all packets flows on int
erface eth1 (useful to sort network issue ([Link]
ow-to/network-traffic-capture-tcp-dump-command/))
$ tcpdump -i eth0 'port 80' => Monitor all traffic on port 80 (
HTTP )
$ lsof => List all open files belonging to
all active processes.(sysadmin favorite command ([Link]
how-tos/lsof-command-list-process-id-information/))
$ lsof -u testuser => List files opened by specific us
er
$ free –m => Show amount of RAM (daily usage
command ([Link]
$ watch df –h => Watch changeable data continuous
ly(interesting linux command ([Link]
watch-command-disk-usage-seconds/))

4. USERS

$ id => Show the active user id with


login and group(with screenshot ([Link]
ux-id-command/))
$ last => Show last logins on the syste
m (few more examples ([Link]
ecords-user-logins-and-last-reboots/))
$ who => Show who is logged on the sys
tem(real user who logged in ([Link]
ho-command/))
$ groupadd admin => Add group "admin" (force add
existing group ([Link]
$ useradd -c "Sam Tomshi" -g admin -m sam => Create user "sam" and a
dd to group "admin"(here read all parameter ([Link]
-command/linux-user-add-command/))
$ userdel sam => Delete user sam (force,file r
emoval ([Link]
$ adduser sam => Add user "sam"
$ usermod => Modify user information(mostl
y useful for linux system admins ([Link]
nux-usermod-command-to-modify-user-details/))

4 de 10 04/04/14 10:38
Linux Commands In Structured Order with Detail... [Link]
5. FILE COMMANDS

$ ls –al => Display all information abo


ut files/ directories(20 examples ([Link]
inux-ls-command/))
$ pwd => Show current directory path
(simple but need every day ([Link]
d-command/))
$ mkdir directory-name => Create a directory(create m
utiple directory ([Link]
d/))
$ rm file-name => Delete file(be careful of u
sing rm command ([Link]
$ rm -r directory-name => Delete directory recursivel
y
$ rm -f file-name => Forcefully remove file
$ rm -rf directory-name => Forcefully remove directory
recursively
$ cp file1 file2 => Copy file1 to file2 (15 cd
command examples ([Link]
)
$ cp -r dir1 dir2 => Copy dir1 to dir2, create d
ir2 if it doesn’t exist
$ mv file1 file2 => Move files from one place t
o another(with 10 examples ([Link]
nd-linux/))
$ ln –s /path/to/file-name link-name => Create symbolic link to fil
e-name (examples ([Link]
nux/))
$ touch file => Create or update file (time
stamp change ([Link]
$ cat > file => Place standard input into f
ile (15 cat command examples ([Link]
-command-examples/))
$ more file => Output the contents of file
(help display long tail files ([Link]
x-more-command/))
$ head file => Output the first 10 lines o
f file (with different parameters ([Link]
inux-head-command/))
$ tail file => Output the last 10 lines of
file (detailed article with tail options ([Link]
ommand/linux-tail-command/))
$ tail -f file => Output the contents of file
as it grows starting with the last 10 lines
$ gpg -c file => Encrypt file (how to use gp
g ([Link]
$ gpg [Link] => Decrypt file

6. PROCESS RELATED

5 de 10 04/04/14 10:38
Linux $Commands
ps In Structured Order with Detail...
# Display your currently[Link]
active pro
cesses (many parameters to learn ([Link]
command-memory-use/))
$ ps aux | grep 'telnet' # Find all process id related to te
lnet process
$ pmap # Memory map of process (kernel,use
r memory etc ([Link]
with-free-and-pmap-command/))
$ top # Display all running processes (30
examples ([Link]
s-screenshots/))
$ kill pid # Kill process with mentioned pid i
d (types of signals ([Link]
rt-1/))
$ killall proc # Kill all processes named proc
$ pkill processname # Send signal to a process with its
name
$ bg # Resumes suspended jobs without br
inging them to foreground (bg and fg command ([Link]
x-command/fg-bg/))
$ fg # Brings the most recent job to for
eground
$ fg n # Brings job n to the foreground

7. FILE PERMISSION RELATED

$ chmod octal file-name # Change the permissions of file to octal


, which can be found separately for user, group and world
octal value (more examples ([Link]
ommand/))
4 - read
2 – write
1 – execute
Example
$ chmod 777 /data/test.c # Set rwx permission for ow
ner , rwx permission for group, rwx permission for world
$ chmod 755 /data/test.c # Set rwx permission for ow
ner,rx for group and world
$ chown owner-user file # Change owner of the file
(chown more examples ([Link]
))
$ chown owner-user:owner-group file-name # Change owner and group ow
ner of the file
$ chown owner-user:owner-group directory # Change owner and group ow
ner of the directory
Example
$ chown bobbin:linoxide [Link]
$ ls -l [Link]
-rw-r--r-- 1 bobbin linoxide 0 Mar 04 08:56 [Link]

6 de 8.
10NETWORK 04/04/14 10:38
Linux $Commands
ifconfig –aIn Structured Order with Detail...
# Display all network ports [Link]
and ip addr
ess (set mtu and other all options ([Link]
ifconfig/),ifconfig now in deprecated network command)
$ ifconfig eth0 # Display specific ethernet port ip ad
dress and details
$ ip addr show # Display all network interfaces and ip
address(available in iproute2 package,powerful than ifconfig)
$ ip address add [Link] dev eth0 # Set ip address
$ ethtool eth0 # Linux tool to show ethernet status (s
et full duplex , pause parameter ([Link]
nge-speed-duplex-settings-ethernet/))
$ mii-tool eth0 # Linux tool to show ethernet status (
more or like ethtool ([Link]
ls_miitool/))
$ ping host # Send echo request to test connection
(learn sing enhanced ping tool ([Link]
hanced-tool-ping/))
$ whois domain # Get who is information for domain
$ dig domain # Get DNS information for domain (scree
nshots with other available parameters ([Link]
eful-options-dig/))
$ dig -x host # Reverse lookup host
$ host [Link] # Lookup DNS ip address for the name (8
examples of host command ([Link]
t-command/))
$ hostname –i # Lookup local ip address (set hostname
too ([Link]
$ wget file # Download file (very useful other opti
on ([Link]
$ netstat -tupl # Listing all active listening ports(tc
p,udp,pid) (13 examples ([Link]
mad-with-all-variant-outputs/))

9. COMPRESSION / ARCHIVES

$ tar cf [Link] home # Create tar named [Link] conta


ining home/ (11 tar examples ([Link]
mmand-options-backup/))
$ tar xf [Link] # Extract the files from [Link]
$ tar czf [Link] files # Create a tar with gzip compress
ion
$ gzip file # Compress file and renames it to
[Link] (untar gzip file ([Link]
targzip-and-tarbzip2-archives-in-ubuntu/))

10. INSTALL PACKAGE

7 de 10 04/04/14 10:38
Linux $Commands In Structured Order with Detail...
rpm -i [Link] # Install rpm [Link]
based packa
ge (Installing, Uninstalling, Updating, Querying ,Verifying ([Link]
[Link]/how-tos/rpm-installation-linux-close/))
$ rpm -e pkgname # Remove package
Install from source
./configure
make
make install (what it is ([Link]
nd-examples/))

11. SEARCH

$ grep pattern files # Search for pattern in files (yo


u will this command often ([Link]
and-find-strings/))
$ grep -r pattern dir # Search recursively for pattern
in dir
$ locate file # Find all instances of file
$ find /home/tom -name 'index*' # Find files names that start wit
h "index"(10 find examples ([Link]
mand-linux/))
$ find /home -size +10000k # Find files larger than 10000k i
n /home

12. LOGIN (SSH AND TELNET)

$ ssh user@host # Connect to host as user (sec


ure data communication command ([Link]
n-ssh-connection-options/))
$ ssh -p port user@host # Connect to host using specif
ic port
$ telnet host # Connect to the system using
telnet port

13. FILE TRANSFER

8 de 10 04/04/14 10:38
Linux scp
Commands In Structured Order with Detail... [Link]
([Link]
$ scp [Link] server2:/tmp # Secure copy [Link]
to remote host /tmp folder
$ scp nixsavy@server2:/www/*.html /www/tmp # Copy *.html files fr
om remote host to current system /www/tmp folder
$ scp -r nixsavy@server2:/www /www/tmp # Copy all files and f
olders recursively from remote server to the current system /www/tmp f
older
rsync ([Link]
$ rsync -a /home/apps /backup/ # Synchronize source t
o destination
$ rsync -avz /home/apps linoxide@[Link]:/backup # Synchronize
files/directories between the local and remote system with compressio
n enabled

14. DISK USAGE

$ df –h # Show free space on mounted filesyste


ms(commonly used command ([Link]
ommand/))
$ df -i # Show free inodes on mounted filesyst
ems
$ fdisk -l # Show disks partitions sizes and type
s(fdisk command output ([Link]
ds-manage-partitions-in-linux/))
$ du -ah # Display disk usage in human readable
form (command variations ([Link]
d-variations-linux/))
$ du -sh # Display total disk usage on the curr
ent directory
$ findmnt # Displays target mount point for all
filesystem (refer type,list,evaluate output ([Link]
x-command/powerful-findmnt-command/))
$ mount device-path mount-point # Mount a device

15. DIRECTORY TRAVERSE

$ cd .. # To go up one level of the direc


tory tree(simple & most needed ([Link]
x-cd-command-examples/))
$ cd # Go to $HOME directory
$ cd /test # Change to /test directory

11.3K 2176

Like Share 13,798 people like this. Sign Up to see what your friends like.

9 de 10 ([Link] ([Link] 04/04/14 10:38


© 2013 LinOxide. All rights reserved.
Linux Commands In Structured Order with Detail... [Link]

10 de 10 04/04/14 10:38

You might also like