Showing posts with label Command Line Utilities. Show all posts
Showing posts with label Command Line Utilities. Show all posts
How to find which Ubuntu Linux version you are running
Labels:
Command Line Utilities,
System Configuration,
Ubuntu
How to find which Ubuntu Linux version you are running.
When you are running multiple Ubuntu machine servers or desktops with different versions, you need to be able to tell which Ubuntu Linux version each machine is running.There are two ways to find out what the Ubuntu Linux version is.
Getting the Ubuntu Linux Version from /etc/issue
The Ubuntu Linux version is written in the /etc/issue file. By invoking the cat command we can print the file content on the screen. Lets find out what is the version of the Ubuntu Linux I am using now.
$ cat /etc/issue
Ubuntu 8.10 \n \l
We can see that this machine is running Ubuntu 8.10
Getting Ubuntu Linux Version from /etc/lsb-release
The /etc/lsb-release file holds the Ubuntu version number and the version code name. Once again using the cat command we can print the file content with the version number and the version code name. Lets run the command on the same machine that we ran the cat /etc/issue command.
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu 8.10"
We can see again that the Ubuntu version is 8.10 but now we know that the Ubuntu 8.10 code name is intrepid.
Lets find the version of two other machines which run different versions of Ubuntu Linux.
machine 1:
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu 8.04.1"machine 2:
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"The first machine is running Ubuntu version 8.04.1 code name hardy. The second machine is running Ubuntu version 7.10 code name gutsy.
Getting Ubuntu Linux Version using the lsb_release command
Using the lsb_release command we can get only the description part from the /etc/lsb-release.
$ lsb_release -d
Description: Ubuntu 9.04
Wednesday, April 01, 2009 | 1 Comments
How to Create & Extract tar.gz and tar.bz2 Files in Linux
Labels:
Command Line Utilities,
File System
The most common compressed archive file format in Linux is the tar.gz format. Tar file is an archive file format. Tar.gz is a compressed tar file.
How to create a compressed tar.gz file from a folder or file in Linux?
In order to create a compressed tar.gz archive from a folder/file we need to run the following tar command:
tar czf new-tar-file-name.tar.gz file-or-folder-to-archive
Here is the command explanation:
- tar - the tar command.
- c - create new archive.
- z - compress the archive using gzip.
- f - use archive file.
- new-tar-file-name.tar.gz - the name of the tar.gz to create.
file-or-folder-to-archive - the name of the folder we want to archive.
How to create a compressed tar.gz file from multiple files and folders in Linux?
In order to create a compressed tar.gz file from multiple files or/and folders we need to run the same tar command we used when we archived a single file/folder and to append the rest of the files/folders' names to it.
tar -czf new-tar-file-name.tar.gz file1 file2 folder1 folder2
How to extract a compressed tar.gz file in Linux?
tar -xzf tar-file-name.tar.gz
Here is the command explanation:
- tar - the tar command.
- x - extract the archive.
- z - uncompress the archive using gzip.
- f - use archive file.
tar-file-name.tar.gz - the name of the tar.gz to create.
How to extract a compressed tar.bz2 file in Linux?
Extracting tar.bz2 (bzip2 file) is very similar to the way you extract tar.gz file. Instead of using the -z flag you need to use the -j flag for the bzip2 format
tar -xjf tar-file-name.tar.gz
Here is the command explanation:
- tar - the tar command.
- x - extract the archive.
- j - filter the archive through bzip2
- f - use archive file.
tar-file-name.tar.gz - the name of the tar.gz to create.
Friday, November 14, 2008 | 0 Comments
Subscribe to:
Posts (Atom)