combine string variables on bash. concatenate string bash

 

 

Using tar command

 

 

using tar command for     Partition backup

 

 

Network Filesystems

NFS Sun’s Network Filesystem (NFS) is the preferred method of file sharing for networks of Unix or Linux computers. The Linux kernel includes both NFS client support

Coda This is an advanced network filesystem that supports features omitted from NFS. These features include better security (including encryption) and improved caching.

SMB/CIFS The Server Message Block (SMB) protocol, which has been renamed the Core Internet Filesystem (CIFS), is the usual means of network file sharing among Microsoft OSs. The Linux kernel includes SMB/CIFS client support, so you can mount SMB/CIFS shares. You can configure your Linux computer as an SMB/CIFS server using the Samba package (http://www.samba.org). The filesystem type code for SMB/CIFS shares is smbfs.

NCP The NetWare Core Protocol (NCP) is NetWare’s file sharing protocol. As with SMB/CIFS, Linux includes basic NCP client support in the kernel, and you can add separate server packages to turn Linux into an NCP server. NCP’s filesystem type code is ncpfs.

chmod command

chmod

chmod [options] mode(s) filename(s) chmod [options] octal_mode(s) filename(s)

The chmod command is used to change the access mode of files. Only the owner of the file or the superuser may alter its access. There are two methods for expressing the mode you wish to assign. The first is the symbolic method, wherein you specify letters representing the mode. This requires that you specify the following information.

Who is affected:

u User who owns the file
g Group (only users in file’s group)
o Other users
a All (default)

What operation:

+ Add permission
Remove permission
= Set permission, overwriting old permissions

What kind of permission:

r Read
w Write
x Execute
s User or group ID is temporarily replaced with that of the file
t Set sticky bit: keep executable in memory after exit

RedHat Linux system proc files contents, descriptions

File Contents
/proc/interrupts IRQ information
/proc/cpuinfo CPU information
/proc/dma DMA information
/proc/ioports I/O information
/proc/meminfo Available, free, swap, and cached memory information
/proc/loadavg System load average
/proc/uptime Time since last reboot
/proc/version Information about kernel version
/proc/scsi Information about SCSI devices
/proc/ide Information about IDE devices
/proc/net Network information
/proc/sys Kernel configuration parameters

Ways To Search For Files Using The Terminal

Today we will look at some of the common ways to search for files in Linux using the Terminal.

1) find : To search for files on the command line you can use the command “find”. The following is syntax for the “find” command:

find path criteria action

“path” – The section of the files system to search (the specific directories and all the sub directories). If nothing is specified the file system below the current directory is used.

“criteria” – The file properties.

“action” – Options that influence conditions or control the search as a whole, ie,
“–print”

 

 

2007-11-22-153941_1280x800_scrot

 

2) locate : The command “locate” is an alternative to the command “find -name”. The command find must search through the selected part of the file system, a process that can be quite slow. On the other hand, locate searches through a database previously created for this purpose (/var/lib/locatedb), making it much faster. The database is automatically created and updated daily. But change made after the update has been performed are not taken into account by locate, unless the database is updated manually using the command updatedb.

 

2007-11-22-154054_1280x800_scrot

 

3) whereis : The command “whereis” returns the binaries (option -b), manual pages (option -m), and the source code (option -s) of the specific command. If no options is used all the information is returned, if the information is available. This command is faster than “find” but is less thorough.

2007-11-22-154226_1280x800_scrot

 

4) which : The “which” command searches all paths listed in the variable PATH for the specific command and returns the full path of the command. the command is specifically useful if several version of a command exist in different directories and you want to know which version is executed when entered without specifying a path.

2007-11-22-154254_1280x800_scrot

 

5) type : The “type” command can be used to find out what kind of command is executed when command is entered – a shell built in command or an external command. The option -a delivers all instances of a command bearing this name in the file system.

2007-11-22-154354_1280x800_scrot

Searching For and Inside Files (find, grep)

The command find is used to find files with various attributes. It has many options. This makes it somewhat awkward for just searching for a file by name. For example, the command

finds all the files in the current directory and any directories below that have a name which ends in .tex and then prints the result of the search at the terminal.

The program grep looks inside files for specified text. For example,

will search the file paper.tex for any occurrences of the text Diophantine” and then then print those lines at the terminal. If you are searching in more than one file as in grep Diophantine *.tex it will print the name of the file in which the line was found.