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/Documentsdirectory.&: This symbol is used to run the command in the background.
Helpful links
More of Cli Tar
- How do I use the Unix tar zip command?
- How do I use the command line to tar and zip a file?
- How do I use the command line to create a tar file?
- How do I use the shell to tar and zip files?
- How do I use the command line to tar and zip a file?
- How do I use the tar command to compress files with gzip?
- How do tar gzip and zip differ in terms of file compression?
- How can I use the CLI to yield a tar file?
- How do I extract a .xz file using the command line?
- How do I use tar gzip with a password?
See more codes...