cli-tarHow can I run a Unix tar command in the background?
To run a Unix tar command in the background, you need to use the nohup
command. This command allows you to run the command after you log out of the terminal session.
For example, to run the tar command tar -cvf archive.tar /home/user/Documents
in the background, you can use the following command: nohup tar -cvf archive.tar /home/user/Documents &
The output of this command will be:
[1] 1234
Code explanation
nohup
: This command allows the command to run after the user logs out of the terminal session.tar -cvf archive.tar /home/user/Documents
: This is the command to create an archive of the/home/user/Documents
directory.&
: This symbol is used to run the command in the background.
Helpful links
More of Cli Tar
- How do I use gzip, tar, and zip to compress files?
- How do I use the shell to tar and zip files?
- How do I use the Unix tar zip command?
- How do I use the command line to tar and distribute files?
- How do I create a tar.zip file in Unix?
- How do I use the command line to tar and zip a file?
- How do I use the command line to tar and zip a file?
- How do I compress a file using gzip and tar.xz?
- How do I use the Unix tar xvf command to extract files?
- How do I use the command line to tar and zip files?
See more codes...