12 Useful Linux Commands
12 Useful Linux Commands
Version 1.0
commands you should know May 23, 2005
By Mellonfire
Takeaway
This download shortens the Linux learning curve by providing a ready reference to common file system tasks and
their respective Linux commands.
Linux commands
There are certain file manipulation tasks common to every operating system. These include tasks like copying
and moving files, creating directories, creating and formatting partitions, and listing file contents.
Graphical operating systems like MacOS X and Microsoft Windows make it easy to perform these tasks through a
point-and-click interface. Users familiar with these systems can thus be forgiven their trepidation about making the
transition to Linux, which more closely resembles the MS-DOS command line. Although graphical interfaces do
exist for Linux (KDE at http://www.kde.org/ is a good example), command-line usage tends to be faster and
more flexible.
This download shortens the Linux learning curve by providing a ready reference to common file system tasks and
their respective Linux commands. Each command is described in brief, with a sample command line and a list of
useful options. Try these commands out for yourself as you read along, and you'll soon be a pro at working with
files in Linux!
Page 1
Copyright ©2005 CNET Networks, Inc. All rights reserved.
For more downloads and a free TechRepublic membership, please visit http://techrepublic.com.com/2001-6240-0.html
12 useful Linux file manipulation commands you should know
Page 2
Copyright ©2005 CNET Networks, Inc. All rights reserved.
For more downloads and a free TechRepublic membership, please visit http://techrepublic.com.com/2001-6240-0.html
12 useful Linux file manipulation commands you should know
Alter a file's chown owner The chown command chown chown -R:
ownership and file alters the user/group joe.users Recursively alter
permissions ownership of a file, while data.txt ownerships
chmod perms the chmod command chown -c: Print a
file alters the corresponding chmod 744 status message
read/write/execute data.txt only if ownership is
permissions. These actually changed
commands are invaluable
to set up access
privileges between
different users of a Linux
system.
Find a file by find path The find command find /tmp - find -maxdepth
name test pattern retrieves a list of all files name *.txt n: Search to a
matching a particular maximum of n
pattern in a directory tree. levels deep in the
Support for sophisticated directory tree
patterns makes this an find -mount:
extremely powerful Limit search to
search tool, and one you current file system
will use often.
Create a link or ln source The ln command ln -s ln -s: Create a
shortcut to a file destination creates a link to a file. /usr/local/my symbolic link
Linux supports both "soft" sql-4.0 ln -f: Overwrite a
(symbolic) and "hard" /usr/mysql pre-existing link
(real) links; ln's default with the same
behavior is to create hard name
links.
Note: You can obtain detailed help on any command by typing man command-name followed by Enter at the
Linux shell prompt.
Page 3
Copyright ©2005 CNET Networks, Inc. All rights reserved.
For more downloads and a free TechRepublic membership, please visit http://techrepublic.com.com/2001-6240-0.html
12 useful Linux file manipulation commands you should know
Additional resources
• Sign up for our TechRepublic NetNote, delivered on Mondays, Wednesdays, and Thursdays.
• Check out all of TechRepublic's newsletter offerings.
• Explore the possibilities of Linux networking with this primer (Download)
• Book Excerpt: Linux Quick Fix Notebook (Download)
• Point & Click Linux!: Dipping a toe into the command-line waters (Download)
Version history
Version: 1.0
Published: May 23, 2005
Thanks!
Page 4
Copyright ©2005 CNET Networks, Inc. All rights reserved.
For more downloads and a free TechRepublic membership, please visit http://techrepublic.com.com/2001-6240-0.html