The Linux move command (mv) is one of the essential commands,
which can be very useful in Linux, Unix, and AIX. The primary purpose of the move command is
obviously to move files, and of course, directories. The move command may also be used to rename
files and to make backups.
$ mv [options] source (file or directory) destination
Move Command options
force move by overwriting destination file
interactive prompt before overwriting
update – move when the source is newer than the
verbose – print source and destination files
MV – t
explicitly saying to move the file or directory here,
rather trying to fit everything into the last argument.
Move all (Multiple) files to a specific director without
listing by name
For More move command
details see the Linux documentation manuals using the man command
$ man mv
Here are some quick and very simple move command (MV)
examples for reference.
Move Move to
files to the /Archive/ directory:
$ mv happy.txt garden.txt /Archive/
Move all “.txt” files
in the current directory to subdirectory backup:
$ mv *.txt backup
Move all files in
subdirectory ‘backup’ to current directory:
$ mv backup/*
Rename file happy.txt
to happy.bak filename:
$ mv happy.txt happy.bak
Rename directory backup
$ mv backup backup2
Update – move when happy.txt
is newer or missing in target directory:
$ mv -u happy.txt backup
Move happy.txt and
prompt before overwrite backup / happy.txt:
Many of us either want a way to import our Linux knowledge,
improve our technical career options or perhaps, move into the technology
career. To do any of these efficiently
them, the first step would be to focus on the major Linux distribution used by
The most adapted distributions Linux are Red Hat Enterprise
Linux (RHEL) and Ubuntu, so, of the multitude of Linux distributions available,
these would be the to learn if you want to move your career forward.
However, if you are seeking an inexpensive alternative to hone your Linux skills at home, then CentOS, is likely your best choice since it is free and is pretty much a copy of RedHat.
In simple terms, yum is a, command-line interface, package manager utility for computers running the Linux operating system, which augments the RPM Package Manager capabilities. yum is the primary tool for getting, installing, deleting, querying, and managing RPM software packages. Also, yum is used in Red Hat Enterprise Linux (RHEL) versions 5 and later.
In Linux there are lot of ways to disk size and/or space, but the ‘Disk Filesystem’ (df) command is old reliable and has been around a long time. The ‘df’ command provides a summary of disk space and free space, which I find myself coming back to time after time.
From time to time there is a need to package up a folder for any number of reasons which may include things like:
Movement to a new location
Movement to a new server
To keep a backup
Or simply to save space
Compressing a folder is folder can be very useful, but for those of us who don’t do it all the time, it is nice to have a pattern to follow. Also, even an experienced user can get brain cramp, if they have not had a reason to compress a folder in a while. So, here is a simple pattern to follow to compress a folder and its contents.
Basic Command Format
tar -zcvf <<archive-name>>.tar.gz <<directory-name>>
Example Compress Command
tar -zcvf blog_files_backup.tar.gz sqlfiles
Linux tar command line options used here
-z = Compress archive using gzip program
-c = Create archive
-v = Verbose i.e display progress while creating archive
-f = Archive File name
For help with the tar command in Linux
To get additional detail on the tar command in Linux, just need to type: