The result is a new file, which has almost five times the reduced size. Here is an example of compressing an SQL file via the command line: gzip nossl_wp18.sql Upon reaching your desired file or folder, please type in the following command: gzip After login inside, you can use the Linux Command Line basics to navigate and locate the file or folder you wish to compress. It is handy for text files, SQL files, or archived files via a different compression type ( zip, tar, tar.gz )īefore using any Linux commands, you need to log inside your account using the SSH protocol. The gzip method of compression is only usable on single files. This knowledgebase article will go over the commands you can use to archive or compress files/folders in a Linux environment through the command-line interface. You may have heard or used compression methods before, especially if you are using ( Windows) WinRAR or tar and gzip ( Unix), and zip which usually is cross-platform compatible. It uses encoding technology, and the purpose is to reduce the targeted inode’s bit structure and prep it for faster transfer or simply bring down its disk space utilization. These represent shortcuts to certain commands and are activated using the corresponding function key (i.e F1 for help, F5 to copy, etc).Data compression, or sometimes referred to as archiving, is a service that helps you lower the original size of a folder or a file, ultimately reducing its disk space usage. You can even use your mouse to select files and function keys to execute commands.Īs you can see on the screenshot, there are numbers from 1 to 10 at the bottom of the console screen. You can easily copy/move files from the left side directory to the right side using a semi-visual approach. Once inside the application you will see two sections – left and right. All our servers have mc installed and it is available by executing the mc command using the SSH Shell. To overwrite already existing files you should use the -f argument: cp -Rf includes/ admin/includes/Ī more convenient way to copy files/folders is to use a 3rd party application, such as Midnight Commander. R instructs cp to copy files recursively (for example, a whole directory). The command will copy the original_file file to new_file and will preserve the original one (the file will NOT be removed after it is copied).Ĭp also accepts various arguments: cp -R includes/ includes_backup/ The copy ( cp) command works the same way as mv, but instead of moving the files/folders it copies them. In some cases, however, you will need to only update and move only files that were changed, which you can do by passing -u as an argument to the command: mv -u includes/* admin/includes This will move all files (and folders) from the includes/ directory to the current working directory. You can also use mv to move a whole directory and its content: mv includes/*. The mv command syntax looks like this: mv original_file new_nameīy executing the above command you will move (rename) the file original_file to new_name. The commands which you would need to use are mv (short from move) and cp (short from copy). Often you will need to move one or more files/folders or copy them to a different location.
0 Comments
Leave a Reply. |