Useful Linux Commands

1 Ιουλίου, 2008 at 3:43 μμ 4 Σχόλια

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. Tags: , , , , , , , , , , , , .

Η Google κάνει index και Flash Now with Flickr!

4 Σχόλια Add your own

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

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

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

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

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

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

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

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

    Απάντηση

Αφήστε απάντηση στον/στην prts1 Ακύρωση απάντησης

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!!!

RSS my recent Tweets

  • Παρουσιάστηκε σφάλμα. Το κανάλι ίσως είναι εκτός λειτουργίας. Δοκιμάστε αργότερα.

RSS my Shared items

  • Παρουσιάστηκε σφάλμα. Το κανάλι ίσως είναι εκτός λειτουργίας. Δοκιμάστε αργότερα.

Archives

my del.icio.us

Creative Commons

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