How Do I Untar A Tar.gz File To Multiple Directories?

Hey everyone,

I am trying to find a way to untar a file.tar.gz in my home/noob directory into 15 different directories.

where the tar.gz file is located: /home/noob
where the 15 directories are located: /home/noob/Staging/ 1-15 folders

Without having to extract the tarball individually, is there a simple way in one or two commands that can take the tarball and extract it to all 15 folders ?

Please and thanks!


Similar Content



Having Problem While Inserting New Enteries In Csv File

Hi Experts,

I am trying to make new enteries in a csv file in new column but am not able to do so.Please help for the same.

Requirement:

There are multiple directories & within those directories i have sub-directories and i want to build a csv file with 2 columns of Directories mapped to their sub-directories. Can you please help me with this. I tried the following code:

Code:
#!/bin/bash

homeDir="$HOME"



ls ~/Parent/ | cut -c1-9 > ~/test_111.csv

while read Child

do

Entry="$(ls $homeDir/Parent/$Child/ABC/XYZ/DEF/PQR)"

echo $Entry

for (( c=1; c<=5; c++ ))

do



sed -i ci"$Entry" test_222.csv

done


done < test_111.csv

Basically i want two columns of csv file , First column should have Child name & Second cloumn should have Sub-Directory name inside PQR Directory.

Any help will be useful on this.

Thanks in Advance!

Best Regards,
Vijay Bhatia

Hidden Folders And Files Become Viewable In Home Directory

Hi guys,
.
For no apparent actions from me, hidden folders and files show
in my /user/home directory, they are as follows:-

folders:
.adobe .cache .config .cups .filezilla .gimp-2.8 .gnupg .gphoto .gstreamer-0.10 .icedtea .java .local .macromedia .mozilla .pki .thumbnails

Files:
.bash_history .bashrc .esd_auth .ICEauthority

In my / directory
File: ./readahead

Seeking help to verify the above folder and files are not from a harmful source or application?

If they do not post any thread to the system, how can I conceal
these folders and files, so that they don't show up any more in
my home and / directory ?

Many thanks.

Move And Extract Specific Files From Sub-directories Into Parent Directory.

Hello all.
I have 100 sub-directories that "rar" files exist in them, How can I move all rar files into parent directory?

I used "find sourcedir -type f -exec mv {} targetdir \; " but i just copy one file and all files deleted

Thank you.

Exporting Log Data To A File That Matches Stdout

hey guys,

Let's say I want to find out which log files have related ntp information in them. I use cat and grep to search through the files in /var/log and then export that to a file. this is the command...

# cat /var/log/* | grep ntp > /home/log.txt

The file created from this command will not include the directories the log entries are apart of. Why not? For example, if you do this same command without exporting to the /home/log.txt file it will show you in stdout which directory each log entry is in. Hope I'm making sense here. My question is, is there a clever way to export to a file in a way so that the file created is structured exactly like the stdout of the command below?

# cat /var/log/* | grep ntp

Script To Scan /home For Folders With 777 Permission

Hello

How can I prepare a script which will scan /home for folders with 777 permission and then it will set 755 permissions on those folders.

command find /home/ -type d -perm 777

will scan the /home for folders with 777 permission, but know I need to set 755 permission on this folders.

Please help in resolving this issue.

Thank you

Regards!
Jeff80

Changing User Name Slight Hangup

hi-

Today I switched my linux username and changed to /home/newname. I am doing this because it is not secure to broadcast your username to the world.

At this link:

http://askubuntu.com/questions/34074...ge-my-username

I am wondering if there is a way to do it a little better for me.

Quote:
You can either keep a symlink for backward compatibility, e g ln -s /home/newname /home/oldname or you can change the file contents with sed -i.bak 's/*oldname*/*newname*/g' *list of files* It creates a backup for each file with a .bak extension.
I tried to do a symlink.

It is not working exactly the way I had hoped. I may not understand it.

When I do the command ls -l I had to make an alias command with awk to parse out the user when i display it. That isn't a big deal but I noticed the oldname and newname are in the printout before filtering it with awk.

Also, my old home directory (the one that matches my /home/oldname is not deleted).

I can log in and the desktop looks fine. I indeed have a new /home/newname.

At one point can I delete the /home/oldname.

Is it okay that ls -l is picking up both usernames (new and old) in separate columns?

I wanted to bounce this off a more experienced user to see if there are some minor adjustments I can do to improve not having 2 home directories and if it is okay for ls -l to display both the old and new user name.

thanks!

mtdew3q

Sftp User Unable To See Mounted --bind Directories. Works With Vsftpd Via Ftp

Is there an sftp package that can be used which is more flexible then the ssh internal ftp server. I have been tasked with providing an /srv/ftp/ directory which includes

mount -bind other_directory1 /srv/ftp/d1
mount -bind other_driectory2 /srv/ftp/q2

...etc

Since sftp via ssh demands that all directories be owned by root I have a problem. The 'other directories' are owned by different sets of groups. We have engineers who will have carte blanche access. I have another group 'manufacturing' who will need to be chrooted to /var/ftp/. They will need to see directories underneath /var/ftp/ and nothing else. We don't want them to be able to cd to any other part of the system. Manufacturing does not have any account on the machine. My last group sales has an account on the server. I have been able to chroot them to there home folder where they also have the same mount --binded directories. Management would like sales to be able to ftp as well as sftp with read only access to the sub directories under their home directory. It is allowable to have them sftp to /srv/ftp/ and ftp to /home/sale/. I would suppose that this may mean that I use a different tool to implement sftp rather then use ssh. Here are my setup files for ssh

Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
UseDNS no
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
GSSAPIAuthentication yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
UseLogin yes
Banner /etc/issue.net
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM no

Match group ftpgroup
ChrootDirectory /srv/ftp
X11Forwarding no
AllowTcpForwarding no
ForceCommand /usr/lib/openssh/sftp-server
PasswordAuthentication yes

How To Extract A Rar File In Linux,file Was Located In Downloads,explain Clearly With

How to extract a rar file in linux,file was located in downloads,explain clearly with an example

Copy Many Files In To Many Directories

Hello every one,

I need to copy many files in to many folders in once, for example I have files result_1 result_2 result_3 and want to copy them to directories 1 2 3 respectively, how can I do that, I have tried cp, echo and find syntax but did not work out.
Any idea?

Why Vsftp Can Do It, But Openssh Sftp Cannot ? (chroot)

Dear all,

This is long story cut short, with vsftp, if i set this parameters in the vsftp.conf file below

Code:
local_enable=YES
chroot_local_users=YES

I am able to login to the ftp account, see and list my home/user directory, and if i do a cd / or cd .. , i will still be chroot to my /home/user directory.

without, the need to chmod or or chown anything to my /home/user directory

=============================================

With openSSH, internal_sftp, even though I have set the sshd_conf to

Code:
Match user alankoh
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
ChrootDirectory /home/%u

I will need to change owner my /home/user directory to have root becomes it owner.
============================================

Q1) why this difference ? How does vsftp chroot without changing the /home/user folder ownership ?

Q2) i realize that openssh ChrootDirectory parameter causes my default login directory to be set as that of the parameter.
(e.g. if i set to "/whatever/xyz", i will be brought to that /whatever/xyz everytime i login to the sftp instead of my /home/user folder.

Why ? I thought that ChrootDirectory is just a security measure to specify the directory to go to in case the user cd to root (e.g. cd /), else not, i should still go to my /home/user folder everytime i login to sftp.

Regards,
Noob