Make and Extract tar files
The tar command is an archiving utility that enables you to combine files and directories into a single file (like an uncompressed zip file). This file can then be compressed to save space. To archive and compress a directory of files, such as /var, use the following:
pi@raspberry ~ $ tar cvfz var_backup.tar.gz /var
In the following commands (c) means new archive, (v) means verbosely list files, (z) means compress with gzip, (r) means append files to the end if tar archive (j) option tells tar to read or write archives using the bzip2 compressor, and (f) means archive name follows. You might also see .tar.gz represented as .tgz.
• tar cvfz name.tar.gz /var
This command compress with gzip form.
• tar cvfj name.tar.bz2 /var
Compress with bzip2 compression (typically a longer delay, but smaller, file). Enter all commands in this table on a single line.
• tar cvfJ name.tar.xz /var
Compress with xz file format (used in .deb package files)
• tar xvf name.tar.*
Decompress compressed fi le (x indicates extract). It will auto-detect the compression type (e.g., gzip, bz2).
• tar xvf name.tar.* /dir/file
Extract a single fi le from an archive. Works for a single directory too.
• tar rvf name.tar filename
Add another file to the archive.
•
This command compress with gzip form.
• tar cvfj name.tar.bz2 /var
Compress with bzip2 compression (typically a longer delay, but smaller, file). Enter all commands in this table on a single line.
• tar cvfJ name.tar.xz /var
Compress with xz file format (used in .deb package files)
• tar xvf name.tar.*
Decompress compressed fi le (x indicates extract). It will auto-detect the compression type (e.g., gzip, bz2).
• tar xvf name.tar.* /dir/file
Extract a single fi le from an archive. Works for a single directory too.
• tar rvf name.tar filename
Add another file to the archive.
•
tar cfz name-$(date +%m%d%y).tar.gz /dir/filename
Create an archive with the current day’s date; useful for scripts and cron job backups. Note that there must be a space between date and +%m%d%y.Logging in as Root
As I concern as root is not only simply a directory but also it is the one and only user of your Raspbian OS. By default the directory /home/pi is a user group. It has no root access or neither administrative power. In order to solve this problem we can use sudo su or sudo -i commands to login as root.
The sudo su used for switch one user to another. Since there is only one user sudo su takes you to root. If there were a user group with name arun under /home sudo su arun switches you to arun after giving correct password for login as arun. We can also create user groups that has all administrative privileges like root. I will explain it later.
The sudo -i command login you to root and it will give you more I/O control and give chance to login to any interactive shell. Since sudo -i gives more I/O control I will prefer you to use sudo -i on your Raspberry Pi.
How can I check my memory card has bad blocks or not?
badblocks /dev/mmcblkX
Check for bad blocks on the SD card. SD cards have wear leveling
controller circuitry. If you get errors, get a new card; don’t record them using fsck. Run this with root permissions and be aware that it takes some time to run. The X in this command is usually a number. To know this number use follow command:
ls /dev/
This will list all of the directories and file in the dev directory. From this you can find out some files like mmcblk0, mmcblk1, mmcblkX 2 etc.. It is not easy to find out which file is exactly contains the information about badblock of memory card. So use alternative values for X until this command gets executed. Don't blindly use values for X the output of ls /dev/ will help you to choose value for X as I mentioned earlier.
lainisWrhome_1977 Candice Hall https://wakelet.com/wake/3lhmGH2eIvxsF9J2D12zz
ReplyDeleteconttipslistsu
smarinter_so Sarah Metcalf Click here
ReplyDeleteClick
genmocorpo