Difference between revisions of "Linux Commands"
From GWAVA Technologies Training
(→Copy a file) |
|||
Line 47: | Line 47: | ||
To copy to the current directory | To copy to the current directory | ||
cp /software/origin.file . | cp /software/origin.file . | ||
+ | |||
+ | ==Network== | ||
+ | Find the IP address of the server | ||
+ | ifconfig | ||
+ | |||
+ | look up mx records | ||
+ | host -t MX [domain.com] | ||
+ | |||
+ | Determine hosts | ||
+ | cat /etc/resolv.conf | ||
+ | |||
+ | DNS | ||
+ | nslookup "Enter" | ||
+ | server "Enter" | ||
+ | |||
+ | Trace the route to a server | ||
+ | traceroute [domain.com] |
Revision as of 15:27, 19 November 2015
Useful Linux Commands
Contents |
Disk
gives you a quick overview of what disks are mounted and how full they are.
df -h
This is give you a total size of the directories under where this command was run and sorts by size. Warning can take a long time.
du -hsx * | sort -rh | head -10
List of files
This always works (show file size in bytes)
ls -s
This is a SLES alias of the above
l
File size in human-readable values (K,M,G)
l -h
Sorted by size ascending human-readable
l -Srh
Sorted by time ascending human-readable
l -trh
Download a file
Download the Latest Version of Retain
wget "http://download.gwava.com/download.php?product=Retain&version=current"
Find a file
find / -name "fileName"
Using find to recursively unzip all items in a directory structure to the current directory.
find /zippedDir -name "*.zip" -exec unzip {} \;
Copy a file
cp origin /destination/file
To copy particular files recursively
cp -r *.txt /destination
To copy to the current directory
cp /software/origin.file .
Network
Find the IP address of the server
ifconfig
look up mx records
host -t MX [domain.com]
Determine hosts
cat /etc/resolv.conf
DNS
nslookup "Enter" server "Enter"
Trace the route to a server
traceroute [domain.com]