SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
Unix Command
Line Productivity
      Tips
          Keith Bennett
 Bennett Business Solutions, Inc.
     http://www.bbsinc.biz


                                    1
Shell Goodness

    • The shell enables a huge amount of flexibility, and is only
          as complex as you want it to be (i.e. it is simple to use it
          simply).
    • Available natively on all Unix platforms, including Linux
          and Mac OS X.
    • Available on Windows by installing Cygwin
          (cygwin.com).
    • Bash is great, but I like Zshell (zsh) even better. There are
          other shells as well.



Unix Command Line Productivity Tips       http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                     2
Using Shell Commands in Scripting
                   Languages
      In addition to the obvious command line use case, shell
      commands can be executed from within programs.
      Shell commands can be executed from Ruby scripts, for
      example, as a powerful sysadmin tool:
      def num_empty_subdirs_of_current_dir
           `find . -type d -empty | wc -l`.to_i
      end

      Certainly it is preferable to use tools in your language for
      accomplishing these tasks, if you have them. Nevertheless,
      when the target environment is known to have standard
      Unix commands, this approach is sensible.
Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 3
Chaining and Scripting

      Unlike performing tasks in a GUI, using the command line
      enables easy chaining and scripting:
      Chaining:
      > echo $PATH
      > echo $PATH | tr : n
      > echo $PATH | tr : n | grep /bin

      Scripting:
      > for f in **/*; do cp $f $f.bak; done
      > for f in **/*.jar; do md5sum $f > $f.md5; done




Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 4
Redirection

      The output of any command can be redirected to a file or to
      another command, any number of times:
      > ls **/*jpg > jpg-dir.txt
      > ls | sort -r | less
      > echo c:b:b:a | tr : n | sort -u                        > abc.txt

      Stderr can also be redirected by using 2> and 2|:
      >a-nonexistent-command
      zsh: command not found: a-nonexistent-command
      >a-nonexistent-command 2> /dev/null
      # (produces no output)


Unix Command Line Productivity Tips     http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                   5
Recursive Directory Listings

      Can’t find “foo.txt” in your directory tree? Do:
      > ls **/foo.txt

      Want to view it? No need to specify its directory. Do:
      > less **/foo.txt # or mate, or emacs, or vi...

      Want to delete all those *~ files? Do:
      > rm **/*~

      (Use expansion, tab key in zsh, to view files before
      deleting.)




Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 6
Recalling Previous Commands

      The history command will show you a list of the most
      recently used commands, with command sequence
      numbers. To specify a previously issued command:
    • use the up and down arrow keys to scroll through the
          history
    • use ”!” and the command number, or “!!” for the most
          recent command.
    • use [ctrl-r]: recall a previous command containing a
          desired string by typing [ctrl-r] and the string. Then
          continue to press [ctrl-r] to cycle through the matching
          commands. They can be edited.
Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 7
Changing Directories

      > cd /etc                       # change to absolute path
      > cd mypath                     # change to relative path
      > cd ~                          # change to home directory
      > cd                            # same as cd ~ (unlike DOS/Windows)
      > cd -                          # toggles current and previous directory
      > pushd/popd # directory stack

      If the shell finds a CDPATH environment variable, then all
      directories in that path will be searched for the subdirectory
      when a relative cd is executed:
      > export CDPATH=~/docs
      > cd a_doc_subdir # will work even when not in ~/docs

Unix Command Line Productivity Tips           http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                         8
mkdir -p

      Creates a subdirectory with all necessary intermediate
      directories in a single command:
      > mkdir -p a/really/deep/directory/tree

      A shortcut for capturing the last parameter in the previously
      executed command is !$, so you can do this to change to
      that new directory:
      > cd !$

      As stated before, to jump back up, you can do:
      > cd -




Unix Command Line Productivity Tips    http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                  9
man and info

• For more information about a command, run man and/or
      info on it:
      > man ls
      > info ls

• For commands built into the shell, query the documentation
      of the shell itself:
      > man bash
      > man zsh

• In KDE you can get a nicely formatted web page with the
      man or info help by typing man:ls, info:ls, etc. in
      Konqueror or the Alt-F2 command prompt.

Unix Command Line Productivity Tips      http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                    10
grep

      The grep command filters text lines to show only those that
      match your target string. Common options are:
           •     -i case insensitive
           •     -v reverse the filter (show only nonmatches)
           •     -C show context lines before and after matching line
           •     -r recurse directories
      >    grep localhost /etc/hosts
      >    echo $PATH | tr : n | grep /bin
      >    alias lsd=”ls -l | grep ^d”
      >    grep -i i18n *.txt
      >    grep -ir -C4 install .


Unix Command Line Productivity Tips    http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                  11
find

      Lists all directories and files recursively, with many options:
    • -name # name filtering, including regex
    • -type # directories, files, links, sockets, and more
    • -depth, -mindepth, -maxdepth # directory depth
          constraints
    • -empty # file or directory is empty
    • -exec, -execdir, -ok, -okdir, -delete # run a command on
          each entry found
    • (others) - file date/time filtering, link count, group

Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 12
find

      Count all empty directories:
      > find . -type d -empty | wc -l

      Count and delete them:
      > find . -type d -empty -delete -print | wc -l

      List info on all files with size > 1 MB (2048 * 512):
      > find . -size +2048 -ls

      Find files changed <= 30 minutes ago:
      > find . -cmin -30




Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 13
less

      less is a simple text mode file pager. It’s really fast, and
      handy for simple text file viewing. less has more features
      than more, though on some systems more might be an alias
      for less.
      > less a-text-file.txt

    •     g,G - go to start/end of file
    •     [space], [PgDn], b, [PgUp] - page down/up
    •     / - find text in a file
    •     n - find next match in a file
    •     h - get help
Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 14
diff

      The diff command outputs the difference, if any, between
      two text files.

      > diff before.txt after.txt



      See info and man pages for more options such as
      whitespace and blank line handling, case insensitivity,
      inclusion of context lines, and output format.




Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 15
lsof

      lsof lists all open files.
    • -c option lists all files opened by the command whose
          name beings with the specified argument:
      > lsof -c thunderbir | wc -l
                   105
      > lsof | wc -l
                866
      > sudo !!
      sudo lsof | wc -l
                1817


Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 16
du

      The du command displays directory usage storage for the
      current directory and its subdirectories, listed individually.
    • default unit of measure is blocks (typically 1024 bytes).
    • -h option displays numbers in more human readable
          format (e.g. “6.8 G”).
    • -s option displays a single number that is the sum of the
          storage of all directories in the tree.




Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 17
df

      The df command displays the disk usage of the filesystem.
    • -h option displays the sizes in human readable format,
          where the units of measure are multiples of 1024.
    • -H option displays the sizes in human readable format,
          where the units of measure are multiples of 1000.
      > df -h | grep disk
      /dev/disk0s2                    149Gi   137Gi                   11Gi       93%                /
      > df -H | grep disk
      /dev/disk0s2                     160G      147G                  12G       93%                /




Unix Command Line Productivity Tips           http://www.bbsinc.biz          Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                                18
tee

      tee takes input and sends it both to standard output and to a
      file. This allows you to both monitor the output and save it
      to a file for later viewing or processing.
      > find / | tee ~/allfiles.out

    • -a option appends to the output file rather than
          overwriting it.
      > find dir1 | tee               dirs1and2.out
      > find dir2 | tee -a dirs1and2.out




Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 19
locate
      locate searches a data base containing a snapshot of all the
      files on your filesystem for a file name or name fragment.
           • Because it searches a data base rather than scanning
                 the file system realtime:
                  • It is extremely fast.
                  • It will not reflect changes that occurred to the
                        filesystem since the filesystem snapshot was made.
           • The snapshot is created by the updatedb command
                 (/usr/libexec/locate.updatedb on OS X).
           • On some Linux distributions, the snapshot is
                 regenerated once a day by default.

Unix Command Line Productivity Tips    http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                  20
zip / unzip

      In addition to tar, the zip and unzip command line tools
      can be very handy. To see a zip file's content:
      > unzip -v myzipfile.zip

      Combine with grep to find files whose names end in “html”:
      > unzip -v myzipfile.zip | grep html$

      To create a zip file in a backup directory, containing the
      current directory and all its subdirectories, do:
      > zip -r ~/bu/docs-YYYYMMDD-HHMM.zip *




Unix Command Line Productivity Tips     http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                   21
Aliases

      Aliases provide abbreviations for your commonly used
      commands. They can be created on the command line or
      in your .bashrc or .zshrc file.
      > alias countlines=”wc -l”
      > alias show-empty-dirs=quot;find . -type d -emptyquot;
      > alias 
      count-empty-dirs=quot;show-empty-dirs | countlinesquot;
      > alias showpath='echo $PATH | tr : n'
      > alias lsd='ls -l | grep ^d' # list directories




Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 22
Environment Variable Overrides

      To override the value of an environment variable for a
      single command, just specify the desired value before the
      command:
      > echo quot;puts ENV['FOO']quot; > test.rb
      > chmod +x test.rb
      > ruby test.rb                  # FOO not defined
      nil
      > FOO=xyz ruby test.rb                    # FOO defined on cmd line
      xyz




Unix Command Line Productivity Tips        http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                      23
Symbolic Links

      Find yourself often navigating several levels deep, many
      times? Create a symbolic link:
      > ln -s work/yadameter/biz/bbsinc/yadameter y

      When you don’t need it anymore, just remove the link:
      > rm y

      The directory pointed to will remain untouched; only the
      link will be deleted.




Unix Command Line Productivity Tips       http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                     24
Symbolic Links

      Symbolic links can also be used to have a constant name
      that always points to the most recent software version. Let’s
      say your JRuby versions are installed in /opt. Your most
      recent version has been 1.1.1. You have created a symbolic
      link, so that your /opt directory contains:
      lrwxr-xr-x   1 root                    staff                 11 Apr 26 20:59 jruby
      -> jruby-1.1.1
      drwxr-xr-x 12 root                     staff                408 Apr 26 20:56
      jruby-1.1.1

      Then you download and install 1.1.2, and update the link:
      >sudo rm jruby ; sudo ln -s jruby-1.1.2 jruby


Unix Command Line Productivity Tips       http://www.bbsinc.biz        Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                          25
Text Mode Terminals in Linux



      To get a text mode terminal, use [Ctrl-Alt-F1]...[Ctrl-Alt-Fn].
      This can be useful if you have X Windows problems and
      cannot start up your desktop environment.




Unix Command Line Productivity Tips   http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                 26
Other Handy Tools

    • [ctrl-L] or clear – clears the screen
    • ncftp – a full featured text mode ftp client with command
          recall and other nice features.
    • mc – Midnight Commander – if you ever find yourself
          having to work on a server without a graphical desktop
          environment, this will make file management easier. Old
          technology, but can be more productive than raw
          commands.
    • nc - netcat; like cat, but sends output to, or reads input
          from, a TCP/IP port. Combined with tar, can be used to
          copy an entire filesystem over a network more efficiently
          than a file by file copy.

Unix Command Line Productivity Tips         http://www.bbsinc.biz   Copyright 2008, Bennett Business Solutions, Inc.



                                                                                                                       27

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Unix
UnixUnix
Unix
 
Introduction to UNIX Command-Lines with examples
Introduction to UNIX Command-Lines with examplesIntroduction to UNIX Command-Lines with examples
Introduction to UNIX Command-Lines with examples
 
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
Linux Command Suumary
Linux Command SuumaryLinux Command Suumary
Linux Command Suumary
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpoint
 
Linux
Linux Linux
Linux
 
Linux final exam
Linux final examLinux final exam
Linux final exam
 
Unix practical file
Unix practical fileUnix practical file
Unix practical file
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Piping into-php
Piping into-phpPiping into-php
Piping into-php
 
Unix - Filters/Editors
Unix - Filters/EditorsUnix - Filters/Editors
Unix - Filters/Editors
 
Unix command line concepts
Unix command line conceptsUnix command line concepts
Unix command line concepts
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
Linux
LinuxLinux
Linux
 

Destaque

Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duoJoshua Thijssen
 
Unix command-line tools
Unix command-line toolsUnix command-line tools
Unix command-line toolsEric Wilson
 
Web Application Security with PHP
Web Application Security with PHPWeb Application Security with PHP
Web Application Security with PHPjikbal
 
Web Application Security: Introduction to common classes of security flaws an...
Web Application Security: Introduction to common classes of security flaws an...Web Application Security: Introduction to common classes of security flaws an...
Web Application Security: Introduction to common classes of security flaws an...Thoughtworks
 
Defeating The Network Security Infrastructure V1.0
Defeating The Network Security Infrastructure  V1.0Defeating The Network Security Infrastructure  V1.0
Defeating The Network Security Infrastructure V1.0Philippe Bogaerts
 
Learning sed and awk
Learning sed and awkLearning sed and awk
Learning sed and awkYogesh Sawant
 
Practical unix utilities for text processing
Practical unix utilities for text processingPractical unix utilities for text processing
Practical unix utilities for text processingAnton Arhipov
 
Practical Example of grep command in unix
Practical Example of grep command in unixPractical Example of grep command in unix
Practical Example of grep command in unixJavin Paul
 
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAPVirtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAPMichael Coates
 
Secure Shell(ssh)
Secure Shell(ssh)Secure Shell(ssh)
Secure Shell(ssh)Pina Parmar
 
Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014iimjobs and hirist
 
RHCE FINAL Questions and Answers
RHCE FINAL Questions and AnswersRHCE FINAL Questions and Answers
RHCE FINAL Questions and AnswersRadien software
 
Introduction to SSH
Introduction to SSHIntroduction to SSH
Introduction to SSHHemant Shah
 

Destaque (20)

Secure shell protocol
Secure shell protocolSecure shell protocol
Secure shell protocol
 
Secure SHell
Secure SHellSecure SHell
Secure SHell
 
Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duo
 
Unix command-line tools
Unix command-line toolsUnix command-line tools
Unix command-line tools
 
class12_Networking2
class12_Networking2class12_Networking2
class12_Networking2
 
PHP Secure Programming
PHP Secure ProgrammingPHP Secure Programming
PHP Secure Programming
 
Web Application Security with PHP
Web Application Security with PHPWeb Application Security with PHP
Web Application Security with PHP
 
Web Application Security: Introduction to common classes of security flaws an...
Web Application Security: Introduction to common classes of security flaws an...Web Application Security: Introduction to common classes of security flaws an...
Web Application Security: Introduction to common classes of security flaws an...
 
Defeating The Network Security Infrastructure V1.0
Defeating The Network Security Infrastructure  V1.0Defeating The Network Security Infrastructure  V1.0
Defeating The Network Security Infrastructure V1.0
 
Learning sed and awk
Learning sed and awkLearning sed and awk
Learning sed and awk
 
Practical unix utilities for text processing
Practical unix utilities for text processingPractical unix utilities for text processing
Practical unix utilities for text processing
 
How to Setup A Pen test Lab and How to Play CTF
How to Setup A Pen test Lab and How to Play CTF How to Setup A Pen test Lab and How to Play CTF
How to Setup A Pen test Lab and How to Play CTF
 
Practical Example of grep command in unix
Practical Example of grep command in unixPractical Example of grep command in unix
Practical Example of grep command in unix
 
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAPVirtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
 
SSH - Secure Shell
SSH - Secure ShellSSH - Secure Shell
SSH - Secure Shell
 
Secure Shell(ssh)
Secure Shell(ssh)Secure Shell(ssh)
Secure Shell(ssh)
 
SSH
SSHSSH
SSH
 
Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014
 
RHCE FINAL Questions and Answers
RHCE FINAL Questions and AnswersRHCE FINAL Questions and Answers
RHCE FINAL Questions and Answers
 
Introduction to SSH
Introduction to SSHIntroduction to SSH
Introduction to SSH
 

Semelhante a Unix Command Line Productivity Tips

Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...Jim Birch
 
Intro to the command line
Intro to the command lineIntro to the command line
Intro to the command linegregmcintyre
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentationbrian_dailey
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDTBastian Feder
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDocker, Inc.
 
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.comComandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.comWlademir RS
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake TutorialFu Haiping
 
Red Teaming macOS Environments with Hermes the Swift Messenger
Red Teaming macOS Environments with Hermes the Swift MessengerRed Teaming macOS Environments with Hermes the Swift Messenger
Red Teaming macOS Environments with Hermes the Swift MessengerJustin Bui
 
Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciAtlassian
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyNikhil Mungel
 
Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Bastian Feder
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactAlessandro Selli
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageRené Ribaud
 

Semelhante a Unix Command Line Productivity Tips (20)

Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
 
Intro to the command line
Intro to the command lineIntro to the command line
Intro to the command line
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Top ESXi command line v2.0
Top ESXi command line v2.0Top ESXi command line v2.0
Top ESXi command line v2.0
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDT
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
Linux
LinuxLinux
Linux
 
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.comComandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.com
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
Red Teaming macOS Environments with Hermes the Swift Messenger
Red Teaming macOS Environments with Hermes the Swift MessengerRed Teaming macOS Environments with Hermes the Swift Messenger
Red Teaming macOS Environments with Hermes the Swift Messenger
 
Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola Paolucci
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in Ruby
 
Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compact
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming language
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Unix Command Line Productivity Tips

  • 1. Unix Command Line Productivity Tips Keith Bennett Bennett Business Solutions, Inc. http://www.bbsinc.biz 1
  • 2. Shell Goodness • The shell enables a huge amount of flexibility, and is only as complex as you want it to be (i.e. it is simple to use it simply). • Available natively on all Unix platforms, including Linux and Mac OS X. • Available on Windows by installing Cygwin (cygwin.com). • Bash is great, but I like Zshell (zsh) even better. There are other shells as well. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 2
  • 3. Using Shell Commands in Scripting Languages In addition to the obvious command line use case, shell commands can be executed from within programs. Shell commands can be executed from Ruby scripts, for example, as a powerful sysadmin tool: def num_empty_subdirs_of_current_dir `find . -type d -empty | wc -l`.to_i end Certainly it is preferable to use tools in your language for accomplishing these tasks, if you have them. Nevertheless, when the target environment is known to have standard Unix commands, this approach is sensible. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 3
  • 4. Chaining and Scripting Unlike performing tasks in a GUI, using the command line enables easy chaining and scripting: Chaining: > echo $PATH > echo $PATH | tr : n > echo $PATH | tr : n | grep /bin Scripting: > for f in **/*; do cp $f $f.bak; done > for f in **/*.jar; do md5sum $f > $f.md5; done Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 4
  • 5. Redirection The output of any command can be redirected to a file or to another command, any number of times: > ls **/*jpg > jpg-dir.txt > ls | sort -r | less > echo c:b:b:a | tr : n | sort -u > abc.txt Stderr can also be redirected by using 2> and 2|: >a-nonexistent-command zsh: command not found: a-nonexistent-command >a-nonexistent-command 2> /dev/null # (produces no output) Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 5
  • 6. Recursive Directory Listings Can’t find “foo.txt” in your directory tree? Do: > ls **/foo.txt Want to view it? No need to specify its directory. Do: > less **/foo.txt # or mate, or emacs, or vi... Want to delete all those *~ files? Do: > rm **/*~ (Use expansion, tab key in zsh, to view files before deleting.) Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 6
  • 7. Recalling Previous Commands The history command will show you a list of the most recently used commands, with command sequence numbers. To specify a previously issued command: • use the up and down arrow keys to scroll through the history • use ”!” and the command number, or “!!” for the most recent command. • use [ctrl-r]: recall a previous command containing a desired string by typing [ctrl-r] and the string. Then continue to press [ctrl-r] to cycle through the matching commands. They can be edited. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 7
  • 8. Changing Directories > cd /etc # change to absolute path > cd mypath # change to relative path > cd ~ # change to home directory > cd # same as cd ~ (unlike DOS/Windows) > cd - # toggles current and previous directory > pushd/popd # directory stack If the shell finds a CDPATH environment variable, then all directories in that path will be searched for the subdirectory when a relative cd is executed: > export CDPATH=~/docs > cd a_doc_subdir # will work even when not in ~/docs Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 8
  • 9. mkdir -p Creates a subdirectory with all necessary intermediate directories in a single command: > mkdir -p a/really/deep/directory/tree A shortcut for capturing the last parameter in the previously executed command is !$, so you can do this to change to that new directory: > cd !$ As stated before, to jump back up, you can do: > cd - Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 9
  • 10. man and info • For more information about a command, run man and/or info on it: > man ls > info ls • For commands built into the shell, query the documentation of the shell itself: > man bash > man zsh • In KDE you can get a nicely formatted web page with the man or info help by typing man:ls, info:ls, etc. in Konqueror or the Alt-F2 command prompt. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 10
  • 11. grep The grep command filters text lines to show only those that match your target string. Common options are: • -i case insensitive • -v reverse the filter (show only nonmatches) • -C show context lines before and after matching line • -r recurse directories > grep localhost /etc/hosts > echo $PATH | tr : n | grep /bin > alias lsd=”ls -l | grep ^d” > grep -i i18n *.txt > grep -ir -C4 install . Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 11
  • 12. find Lists all directories and files recursively, with many options: • -name # name filtering, including regex • -type # directories, files, links, sockets, and more • -depth, -mindepth, -maxdepth # directory depth constraints • -empty # file or directory is empty • -exec, -execdir, -ok, -okdir, -delete # run a command on each entry found • (others) - file date/time filtering, link count, group Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 12
  • 13. find Count all empty directories: > find . -type d -empty | wc -l Count and delete them: > find . -type d -empty -delete -print | wc -l List info on all files with size > 1 MB (2048 * 512): > find . -size +2048 -ls Find files changed <= 30 minutes ago: > find . -cmin -30 Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 13
  • 14. less less is a simple text mode file pager. It’s really fast, and handy for simple text file viewing. less has more features than more, though on some systems more might be an alias for less. > less a-text-file.txt • g,G - go to start/end of file • [space], [PgDn], b, [PgUp] - page down/up • / - find text in a file • n - find next match in a file • h - get help Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 14
  • 15. diff The diff command outputs the difference, if any, between two text files. > diff before.txt after.txt See info and man pages for more options such as whitespace and blank line handling, case insensitivity, inclusion of context lines, and output format. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 15
  • 16. lsof lsof lists all open files. • -c option lists all files opened by the command whose name beings with the specified argument: > lsof -c thunderbir | wc -l 105 > lsof | wc -l 866 > sudo !! sudo lsof | wc -l 1817 Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 16
  • 17. du The du command displays directory usage storage for the current directory and its subdirectories, listed individually. • default unit of measure is blocks (typically 1024 bytes). • -h option displays numbers in more human readable format (e.g. “6.8 G”). • -s option displays a single number that is the sum of the storage of all directories in the tree. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 17
  • 18. df The df command displays the disk usage of the filesystem. • -h option displays the sizes in human readable format, where the units of measure are multiples of 1024. • -H option displays the sizes in human readable format, where the units of measure are multiples of 1000. > df -h | grep disk /dev/disk0s2 149Gi 137Gi 11Gi 93% / > df -H | grep disk /dev/disk0s2 160G 147G 12G 93% / Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 18
  • 19. tee tee takes input and sends it both to standard output and to a file. This allows you to both monitor the output and save it to a file for later viewing or processing. > find / | tee ~/allfiles.out • -a option appends to the output file rather than overwriting it. > find dir1 | tee dirs1and2.out > find dir2 | tee -a dirs1and2.out Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 19
  • 20. locate locate searches a data base containing a snapshot of all the files on your filesystem for a file name or name fragment. • Because it searches a data base rather than scanning the file system realtime: • It is extremely fast. • It will not reflect changes that occurred to the filesystem since the filesystem snapshot was made. • The snapshot is created by the updatedb command (/usr/libexec/locate.updatedb on OS X). • On some Linux distributions, the snapshot is regenerated once a day by default. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 20
  • 21. zip / unzip In addition to tar, the zip and unzip command line tools can be very handy. To see a zip file's content: > unzip -v myzipfile.zip Combine with grep to find files whose names end in “html”: > unzip -v myzipfile.zip | grep html$ To create a zip file in a backup directory, containing the current directory and all its subdirectories, do: > zip -r ~/bu/docs-YYYYMMDD-HHMM.zip * Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 21
  • 22. Aliases Aliases provide abbreviations for your commonly used commands. They can be created on the command line or in your .bashrc or .zshrc file. > alias countlines=”wc -l” > alias show-empty-dirs=quot;find . -type d -emptyquot; > alias count-empty-dirs=quot;show-empty-dirs | countlinesquot; > alias showpath='echo $PATH | tr : n' > alias lsd='ls -l | grep ^d' # list directories Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 22
  • 23. Environment Variable Overrides To override the value of an environment variable for a single command, just specify the desired value before the command: > echo quot;puts ENV['FOO']quot; > test.rb > chmod +x test.rb > ruby test.rb # FOO not defined nil > FOO=xyz ruby test.rb # FOO defined on cmd line xyz Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 23
  • 24. Symbolic Links Find yourself often navigating several levels deep, many times? Create a symbolic link: > ln -s work/yadameter/biz/bbsinc/yadameter y When you don’t need it anymore, just remove the link: > rm y The directory pointed to will remain untouched; only the link will be deleted. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 24
  • 25. Symbolic Links Symbolic links can also be used to have a constant name that always points to the most recent software version. Let’s say your JRuby versions are installed in /opt. Your most recent version has been 1.1.1. You have created a symbolic link, so that your /opt directory contains: lrwxr-xr-x 1 root staff 11 Apr 26 20:59 jruby -> jruby-1.1.1 drwxr-xr-x 12 root staff 408 Apr 26 20:56 jruby-1.1.1 Then you download and install 1.1.2, and update the link: >sudo rm jruby ; sudo ln -s jruby-1.1.2 jruby Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 25
  • 26. Text Mode Terminals in Linux To get a text mode terminal, use [Ctrl-Alt-F1]...[Ctrl-Alt-Fn]. This can be useful if you have X Windows problems and cannot start up your desktop environment. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 26
  • 27. Other Handy Tools • [ctrl-L] or clear – clears the screen • ncftp – a full featured text mode ftp client with command recall and other nice features. • mc – Midnight Commander – if you ever find yourself having to work on a server without a graphical desktop environment, this will make file management easier. Old technology, but can be more productive than raw commands. • nc - netcat; like cat, but sends output to, or reads input from, a TCP/IP port. Combined with tar, can be used to copy an entire filesystem over a network more efficiently than a file by file copy. Unix Command Line Productivity Tips http://www.bbsinc.biz Copyright 2008, Bennett Business Solutions, Inc. 27