Skip to main content

Posts

Showing posts with the label UNIX

Basic UNIX commands

Note: not all of these are actually part of UNIX itself, and you may not find them on all UNIX machines. But they can all be used on turing in essentially the same way, by typing the command and hitting return. Note that some of these commands are different on non-Solaris machines - see SunOS differences . If you've made a typo, the easiest thing to do is hit CTRL-u to cancel the whole line. But you can also edit the command line (see the guide to More UNIX ). UNIX is case-sensitive. Files ls --- lists your files ls -l --- lists your files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified. ls -a --- lists all files, including the ones whose filenames begin in a dot, which you do not always want to see. There are many more options, for example to list files by size, by date, recursively etc. more filename --- shows the first part of a f...

How to Create a TAR file ?

tar is a facility in Linux that creates archived file using a set of files. One file will be created that contains all the files in it. But do not get misunderstand, ".tar" file is not a compressed file. It is only a collection of files within a single uncompressed file. TAR 1. Create tar archive $ tar -cf tarFileName.tar file1 file2 file3 This will create an achive named tarFileName.tar and that will include the files specified there (ie: file1, file2, file3). 2. View the list of files $ tar -tf tarFileName.tar This will list the details of the files inside the archive. 3. Extract tar archive $ tar -xf tarFileName.tar This will extract the archive and create the files that were inside the archive. The above options have the meanings as: c - create an archive f - archive file t - list the content of the archive x - extract an archive GZIP If the file is a ".tar.gz" or ".tgz" file it is a collection of files that is compressed. To compr...