Useful Linux Commands
Ιουλίου 1, 2008
Another post in English, just like the Nintendo DS How-To. I think the following commands will be a usefull reference for future use and maybe a “cheat-sheet”. I list them in categories for easier access. If you have any suggestions, questions, want to correct something or want to add a command, feel free to comment below.
Networking Commands:
ethtool eth0Shows status of ethernet interface eth0.iwconfig eth1Shows status of the wireless interface eth1.iwlist scanLists all wireless networks in range.ip route showLists routing table.netstat -tuplLists internet services on a system.netstat -tupLists active connections to/from a system.hostname -iShows localhost IP.
Windows Networking Commands (Samba):
smbtreeLists all Windows machines in a network. (See also findsmb)smbclient-L windows_box Lists shares on windows machine or samba server.mount -t smbfs -o fmask=666,guest //windows_box/share /mnt/shareMount a windows share.nmblookup -A 1.2.3.4Finds the Windows (netbios) name associated with IP address.
Secure Shell (SSH):
ssh $USER@$HOST commandRuns command on $HOST as $USER.ssh -g -L 8080:localhost:80 root@$HOSTForwards connections to $HOSTNAME:8080 out to $HOST:80.ssh -R 1434:imap:143 root@$HOSTForwards connections from $HOST:1434 in to imap:143.
Archives and Compression:
gpg -c fileEncrypts a file.gpg file.gpgDecrypts a file.
CDs:
gzip < /dev/cdrom > cdrom.iso.gzSaves a copy of a data cd-rom.mkisofs -V LABEL -r dir | gzip > cdrom.iso.gzCreates cd-rom image from contents of a dir.mount -o loop cdrom.iso /mnt/dirMounts the cdrom image at /mnt/dir (read only).cdparanoia -BRips audio tracks from CD to wav files in current dir.oggenc --tracknum='track' track.cdda.wav -o 'track.ogg'Makes ogg file from wav file.
Disk Usage/Space:
fdisk -lShows disks partitions sizes and types (run as root -> sudo fdisk -l).df -hShows free space on mounted filesystems.
Monitoring/Logging:
tcpdump not port 22Shows network traffic except SSH.last rebootShows system reboot history.free -mShows amount of (remaining) RAM (-m displays in MB).
System Information:
uname -aShows kernel version and system architecture.head -n1 /etc/issueShows name and version of distribution.cat /proc/partitionsShows all partitions registered on the system.grep MemTotal /proc/meminfoShows RAM total seen by the system.grep "model name" /proc/cpuinfoShows CPU(s) info.mount | column -tLists mounted filesystems on the system (and align output).hdparm -i /dev/sdaShows info about disk sda.
Entry Filed under: Tips, Tweaks and more, Ubuntu. Ετικέτες: console commands, disk usage commands, linux, linux commands, monitoring commands, mount commands, networking commands, samba protocol, SSH commands, system information commands, tar gz, unix, unix commands.
4 Comments Add your own
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed





1.
George Ker | Ιουλίου 1, 2008 at 5:18 μμ
Καλό το post έτσι που τα συγκέντωσες
2.
unseen | Ιουλίου 1, 2008 at 8:00 μμ
ευχαριστώ… πήρε αρκετή ώρα μέχρι να βάλω όλες όσες ξέρω αλλά και να ψάξω γιατί μόνο οι δικές μου δεν έφταναν
3.
prts1 | Ιουλίου 2, 2008 at 3:37 μμ
Γενικά σε θέματα που επεκτείνονται πολύ (όπως πχ. οι ατέλειωτες εντολές της κονσόλας) μια συλλογή μπορεί εύκολα να γίνει σημείο αναφοράς.
4.
Порно | Οκτωβρίου 31, 2008 at 2:39 πμ
Классно, штука полезная!