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 eth0 Shows status of ethernet interface eth0.
  • iwconfig eth1 Shows status of the wireless interface eth1.
  • iwlist scan Lists all wireless networks in range.
  • ip route show Lists routing table.
  • netstat -tupl Lists internet services on a system.
  • netstat -tup Lists active connections to/from a system.
  • hostname -i Shows localhost IP.

Windows Networking Commands (Samba):

  • smbtree Lists 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/share Mount a windows share.
  • nmblookup -A 1.2.3.4 Finds the Windows (netbios) name associated with IP address.

Secure Shell (SSH):

  • ssh $USER@$HOST command Runs command on $HOST as $USER.
  • ssh -g -L 8080:localhost:80 root@$HOST Forwards connections to $HOSTNAME:8080 out to $HOST:80.
  • ssh -R 1434:imap:143 root@$HOST Forwards connections from $HOST:1434 in to imap:143.

Archives and Compression:

  • gpg -c file Encrypts a file.
  • gpg file.gpg Decrypts a file.

CDs:

  • gzip < /dev/cdrom > cdrom.iso.gz Saves a copy of a data cd-rom.
  • mkisofs -V LABEL -r dir | gzip > cdrom.iso.gz Creates cd-rom image from contents of a dir.
  • mount -o loop cdrom.iso /mnt/dir Mounts the cdrom image at /mnt/dir (read only).
  • cdparanoia -B Rips 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 -l Shows disks partitions sizes and types (run as root -> sudo fdisk -l).
  • df -h Shows free space on mounted filesystems.

Monitoring/Logging:

  • tcpdump not port 22 Shows network traffic except SSH.
  • last reboot Shows system reboot history.
  • free -m Shows amount of (remaining) RAM (-m displays in MB).

System Information:

  • uname -a Shows kernel version and system architecture.
  • head -n1 /etc/issue Shows name and version of distribution.
  • cat /proc/partitions Shows all partitions registered on the system.
  • grep MemTotal /proc/meminfo Shows RAM total seen by the system.
  • grep "model name" /proc/cpuinfo Shows CPU(s) info.
  • mount | column -t Lists mounted filesystems on the system (and align output).
  • hdparm -i /dev/sda Shows info about disk sda.

Entry Filed under: Tips, Tweaks and more, Ubuntu. Ετικέτες: , , , , , , , , , , , , .

4 Comments Add your own

  • 1. George Ker  |  Ιουλίου 1, 2008 at 5:18 μμ

    Καλό το post έτσι που τα συγκέντωσες

    Απάντηση
  • 2. unseen  |  Ιουλίου 1, 2008 at 8:00 μμ

    ευχαριστώ… πήρε αρκετή ώρα μέχρι να βάλω όλες όσες ξέρω αλλά και να ψάξω γιατί μόνο οι δικές μου δεν έφταναν :mrgreen:

    Απάντηση
  • 3. prts1  |  Ιουλίου 2, 2008 at 3:37 μμ

    Γενικά σε θέματα που επεκτείνονται πολύ (όπως πχ. οι ατέλειωτες εντολές της κονσόλας) μια συλλογή μπορεί εύκολα να γίνει σημείο αναφοράς. :-)

    Απάντηση
  • 4. Порно  |  Οκτωβρίου 31, 2008 at 2:39 πμ

    Классно, штука полезная!

    Απάντηση

Leave a Comment

Required

Required, hidden

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


Unseen’d – Tech blogging from a 15 year old teen…

I've changed host! Click here to go to apas.gr!!! Apostolos aka Unseen. 15 years old, High School Student from Thessaloniki, Greece. Passionate with gadgets, PCs, Linux and Web 2.0. Tech g33k blogger. Apple fan-boy. Alpine Skier, mountain biker, tracuer, diabolo player. Learn more.

Subscribe:
Get RSS Feed
Get E-Mail Subscription

Friend me Up:

RSS my recent Tweets

RSS my Shared items

Recent Popular

Πρόσφατα άρθρα

Archives

my del.icio.us

my Flickr

Edgar Cards

Twitter #FAIL

Abstract

Abstract 2

More Photos

Creative Commons

Except where otherwise noted, all content is licensed under a Creative Commons Attribution 3.0 Unported License