Using the command line in Linux can be one of the most daunting tasks to a regular Windows User. The Linux command line, or “Shell” is vastly more powerful that the command line you might be used to in windows. On Linux, you can create shell scripts (like a Windows Batch file, but on fists full of steroids).
You can quickly count the lines in text file on a Linux (or other *nix based system) with this command
wc -l < filename
(Of course, you need to substitute the filename with your filename.
Need to do this on a WIndows system? Download cygwin and you can issue the same command from the cygwin command line. The only trick to cygwin is to remember that your root directory (C:\ on most Windows systems) is /cygdrive/c. Then the directory structure is the same from there.
You can see the last 500 or so commands you have entered in the command line on a Linux system with the following command: history
Now, if you want to filter that list you can use grep. For example, if you want to see the files you have edited, you could: history | grep nano
Assuming of course, that you use nano as your text editor.
Recent Comments