Why not use -C
option when creating:
$ tar cf /var/www/site.tar -C /var/www_bak/ site
Related Posts:
- gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now
- Shell command to tar directory excluding certain files/folders
- tar removing leading ‘/’ from member names
- Opening a .tar.gz file with a single command
- tar: Cowardly refusing to create an empty archive
- tar: add all files and directories in current directory INCLUDING .svn and so on
- what does -zxvf mean in tar -zxvf filename?
- tar: Error is not recoverable: exiting now
- How do I grep recursively?
- Why do you need to put #!/bin/bash at the beginning of a script file?
- error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’ — Missing /var/run/mysqld/mysqld.sock
- “E: Unable to locate package python-pip” on Ubuntu 18.04 [duplicate]
- -bash: syntax error near unexpected token `newline’ for display command
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- SSH using python script
- Changing the resolution of a VNC session in linux
- Building HelloWorld C++ Program in Linux with ncurses
- How does “cat << EOF" work in bash?
- Pseudo-terminal will not be allocated because stdin is not a terminal
- X11 forwarding request failed on channel 0
- What is difference between arm64 and armhf?
- How to make and apply SVN patch?
- Diff command along with Grep gives “Binary file (standard input) matches”
- can’t remove python pip
- How to download a file from server using SSH?
- connect to host localhost port 22: Connection refused
- Implementing shell in C and need help handling input/output redirection
- How to count lines in a document?
- What does `set -x` do?
- Can you Run Xcode in Linux?
- How to get the process ID to kill a nohup process?
- Writing a simple shell in C using fork/execvp
- Implementation of multiple pipes in C
- chmod: changing permissions of ‘my_script.sh’: Operation not permitted
- Using ls to list directories and their total sizes
- What does set -e mean in a bash script?
- Gedit command not working in kali linux terminal
- Syntax error near unexpected token ‘then’
- Curl : connection refused
- How to install Android SDK on Ubuntu?
- make -j 8 g++: internal compiler error: Killed (program cc1plus)
- Bash export command
- How to edit gitignore file
- Pipe to/from the clipboard in a Bash script
- Retrieve last 100 lines logs
- Linux Bash: Move multiple different files into same directory
- Adding a new entry to the PATH variable in ZSH
- Configuring Apache for localhost
- how to search for a directory from the terminal in ubuntu
- Android – Command not found
- How to use dos2unix?
- EC2 ssh Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
- How to add a default include path for GCC in Linux?
- What does ‘bash -c’ do?
- How do I know the script file name in a Bash script?
- WordPress can’t find temporary folder, but folder it’s looking at has correct permissions
- How to configure both webserver and appserver for WordPress CMS?
- How to remove all plugins, posts, pages, and inactive themes in one line with wp-cli? WordPress bloatware removal
- Communcation with wordrpess and linux server [closed]
- Can scp copy directories recursively?
- Anyone else experiencing high rates of Linux server crashes during a leap second day?
- What are the functional differences between .profile .bash_profile and .bashrc
- Can I nohup/screen an already-started process?
- Why does my hostname appear with the address 127.0.1.1 rather than 127.0.0.1 in /etc/hosts?
- Linux command to inspect TXT records of a domain [closed]
- df in linux not showing correct free space after file removal
- Setting the hostname: FQDN or short name?
- When does /tmp get cleared?
- What does a + mean at the end of the permissions from ls -l?
- How do I sleep for a millisecond in bash or ksh
- What does ‘set -e’ do, and why might it be considered dangerous?
- What useful things can one add to one’s .bashrc? [closed]
- How to add a timestamp to bash script log?
- best way to clear all iptables rules
- How to remove empty/blank lines from a file in Unix (including spaces)?
- How can I kill all stopped jobs?
- How to copy file preserving directory path in Linux?
- Postfix – how to retry delivery of mail in queue?
- How can I rename a Unix user?
- How to re-order windows, change the scroll shortcut, and modify the status bar contents in GNU Screen?
- Is it possible to alias a hostname in Linux?
- How do I list loaded Linux module parameter values?
- Does getting disconnected from an SSH session kill your programs?
- Tips for Securing a LAMP Server
- What Linux distribution is the Amazon Linux AMI based on?
- How to prevent a user from login in, but allow “su – user” in Linux?
- What is this IP address: 169.254.169.254?
- Should I install Linux applications in /var or /opt?
- I have a keypair. How do I determine the key length?
- Why drop caches in Linux?
- Heartbleed: how to reliably and portably check the OpenSSL version?
- swap partition vs file for performance?
- How can I fully log all bash scripts actions?
- Best way to disable swap in Linux
- Testing UDP port connectivity
- memcache vs memcached?
- zcat/gzcat works in linux, not on osx. general linux/osx compatibility
- How can I zip/compress a symlink?
- What is the debian-sys-maint MySQL user (and more)?
- How to find the physical volume(s) that hold a logical volume in LVM