6
votes
2answers
6k views

How can I do a recursive chmod only on directories?

I want to change permissions on a tree on Centos 4 to add execute permissions for all directories recursively from a directory. If I use normal chmod, files other than directories are also modified: ...
1
vote
2answers
638 views

How to browse through directories in a tree like structure in linux terminal?

Is there a program to browse through directories in a tree like structure in the linux terminal? Example: Suppose I was at /home/username/mysite and typed command_I_am_looking_for then I would get: ...
1
vote
3answers
1k views

BASH: Need if statement to run a task only if number of files in the directory are greater than 1

I want to write a script, but I want an if statement so it will run only if the number of files in the directory are greater than 1. Is this possible?
0
votes
1answer
311 views

Sabnzbd Installed on Linux NAS

I installed SABnzbd on a linux formatted NAS. Now the directory it downloads to is mapped differently on the NAS itself, because the path that SABnzbd knows about starts in it's own folder. If this ...
0
votes
1answer
75 views

already opened files in a directory can still be saved after the directory is deleted - Linux

This is annoying feature of Linux. If I opened a file in a directory and then delete the directory, and copy another directory having the same name to the same place, I can still edit and save the ...
1
vote
2answers
562 views

How do I copy only subdirectories but exclude other files in Linux?

Here is my directory structure: /home/folders/test (some directories) and files test.xml test1.xml test.js images (directory) /home/folders/test/images/( some directories ) and files I have to ...
0
votes
1answer
1k views

Compare content of directories in Linux

In Linux, if I have two directories, how I can see the differences of content in these directories? Now I use this command: diff <(ls -d dir1/*) <(ls -d dir2/*) Any other idea?
1
vote
7answers
5k views

Linux directory full of files with tilde sign(e.g. `example.txt~`), what does it mean and how do I get rid of it?

I have a directory on my linux os(Ubuntu) full of files that start with a tilde sign(e.g. example.txt~, example.py~). When I look at my directury using the regular gui I don't see any files there. But ...
3
votes
4answers
2k views

Finding subdirectories inside all directories with the same name

I want to run a command to: Find all directories named "inc" under a folder "X". List all the subdirectories under each "X/.../inc/". Redirect the output to a file named "list" I tried various ...
4
votes
1answer
897 views

Why are the sizes of 2 directories different if the data within the directories is identical? They are identical ext4 partitions and disks

root@phoenix:~# ls -ld /backups/external?/var/subsonic/thumbs/110 drwxr-xr-x 2 root root 73728 Mar 4 15:35 /backups/external3/var/subsonic/thumbs/110 drwxr-xr-x 2 root root 69632 Mar 4 15:35 ...
6
votes
4answers
437 views

Directory “Bookmarking” in Linux

Aside from aliasing and links, is there an easy way in Linux to tag commonly used directories and to navigate to a commonly used directory from the terminal. To be clear the disadvantages I see with ...
1
vote
1answer
360 views

cd Command Linux and Mystery Flags

Platform: CentOS 6.2 Shell:tcsh I'm playing around with cd for a BASH script, and noticed the wondrous cd - option, but was left with many questions... Why the cd -? Isn't this redundant with cd ...
1
vote
1answer
226 views

Giving directory access to only certain users?

I currently have the following directory: drwxrwsr-x 4 user1 Group1 4.0K Apr 18 18:29 foo Under Group1 there are 20 users. I want to give user2 and user3 who belong to Group1 access to directory ...
0
votes
2answers
1k views

Why does running “$ sudo chmod -R 664 . ” cause me to get access denied on all affected directories?

I have a project folder which has messy permissions on all files. I've had the bad tendency of setting everything to octal permissions 777 because it solved all non security related issues. Then FTP ...
4
votes
1answer
1k views

Can't open folders in Linux nerdtree vim

I can't open folders in nerdtree vim. It won't open the folders, and these funky symbols are being displayed: Does anyone have a clue about how to get this working? I'm running UTF-8.
2
votes
1answer
225 views

Directory transfer from Linux -> Windows; 255 Character limit error

I need to copy a very large directory from a linux server to a windows machine; the directory is very large and contains directories that go as deep as having 50+ subdirectories. So as you could ...
2
votes
2answers
132 views

Linux: Finding the largest directories on web host

I've got a web host (linux hosting) whose disk is almost completely full. How do I list out directories (and their subdirectories) by largest size to figure out where the biggest disk hogs are?
2
votes
1answer
848 views

Linux `mount --bind` made client's folder disappear?

I tried making a VSFTPD user with access to all of our clients' FTP folders. (the users are all chroot'ed to their home directories, where the public_html folders are). What I did was create a new ...
1
vote
1answer
669 views

Gunzip redirection: “No such file or directory”

When I issue the following command: gunzip -c /disk1/hadoop/gunzip_tmp/in/part-00006.gz>>/disk1/hadoop/gunzip_tmp/outfile.000 I get the following stderr: gunzip: ...
0
votes
2answers
108 views

max folders I can store inside a folder in a linux server

Is there a logical limit as to how many folders I can store inside a single folder in a hosting server (linux)? I`m talking about tens of thousands of folders.
1
vote
1answer
476 views

Unable to access a script from root directory in Linux

I have a script in one of I my root directory: /root/scripts/script1.sh I wan't to call that script as another user (james1). I did the following (as root user): root@pc83$ CD scripts root@pc83$ ...
4
votes
2answers
2k views

How to physically reorder files `03.mp3 01.mp3 02.mp3` (`ls -f`) in a directory?

The physical order of the files matters when I copy them onto my USB stick and listen in car mp3 player. Most of my music album folders are unsorted, e.g. ls -f may produce: 03.song3.mp3 01.song1.mp3 ...
1
vote
1answer
213 views

GNU/Linux substitute for the Windows-based TreeComp tool

I miss the TreeComp tool from Windows on Linux. Does anybody know about a similar tool for Linux? I've tried Unison & Unison-gtk (slow and cumbersome), diff (various), meld, mc, rsync (immensely ...
6
votes
1answer
434 views

Linux: which is “most appropriate” directory to place an exectuable for all users?

A bit of newb question.. I usually install packages and don't worry about these things. But, now I have a one file executable CLI program (Kindlegen from Amazon). I want it to be in the path of all ...
3
votes
2answers
389 views

How to reorder folders? (as displayed in `ls -U`)

I've got a number of unordered folders on a memory stick, which my car stereo shows in order of their real position on the stick (i.e. same as ls -U) What's the easiest way of physically reordering ...
1
vote
2answers
1k views

How can I remove a directory with rm - rf?

I try to remove a folder with rm -rf foldername … but it says rm: cannot remove folder :is a directory. What's wrong?
27
votes
1answer
42k views

How do I unzip a tar gz archive to a specific destination?

I want to unpack a .tar.gz file to a specific directory. The archive file is in /root/Documents. I want to unzip it into /root/Desktop/folder. The folder structure in zipped file should be preserved ...
0
votes
2answers
180 views

Linux: Show directory content as if it was a file?

I am a bit confused on what a directory really is. In various places I read that in Linux directories are just strings that keep the names of the nested files. In that case is there a way to show ...
1
vote
2answers
5k views

How can I find a specific file in a directory tree?

Could someone please help me to find all the *.c and *.h files in a directory tree??
3
votes
2answers
150 views

directory listing is showing “+” sign

In one of my directory listing I get following output: drwxrws---+ 7 sip sip 4096 Aug 5 13:25 USSDG I am the member of the group sip but I am not able to create any file if I ...
1
vote
1answer
192 views

Is there a fast method of changing directory to a symbolic links parent or source?

Say I have folder stucture: |- dir1/ | |- sub1/ | |- dir2/ |- sub1link -> /dir1/sub1/ and my current working directory is sub1link, is there a quick way to either: change directory to ...
2
votes
3answers
648 views

Listing tar contents inside directory

this is the script I'm running tar tf some.tar somefolder_insidetar And output it's a list with all folders, files, and SUBDIRECTORY Files, the only thing I need it's just show the contents (folder ...
0
votes
1answer
2k views

Full path while zipping?

I have the following files: ~/Dir1/file1.txt ~/Dir2/file2.txt Then I use the following command: cd ~ zip out.zip /Dir1/file1.txt /Dir2/file2.txt In the out.zip i can see two directories (dir1 ...
4
votes
1answer
420 views

Directory invisible until I cd into it

I have a mysterious directory that doesn't list until I cd into it. Then it does just fine. Then it vanishes again periodically. bash-3.00$ pwd /sde bash-3.00$ ls -la total 16 drwxr-xr-x 4 root ...
1
vote
1answer
431 views

Which are the best file-systems/mount-configuration for each folder on GNU/linux?

One of the good points of Linux is that is easy to customize the partitioning scheme of the disk and put each directory (/home, /var, etc) in different partitions and/or different disk. Then we can ...
1
vote
1answer
214 views

Check difference in file structure

On Linux I've done a rsync syncing supposedly everything in /home to /backup. Both of these disk are the same size, but after the sync du -h shows around 50G difference. I want to know what the 50G ...
1
vote
2answers
2k views

How do I extract a RAR archive in Linux

How can we extract a .rar archive in Linux?
2
votes
1answer
3k views

Rsync difference between two directories to a 3rd directory

How would I go about rsyncing the difference between two directories to a 3rd directory. For example, if I have the command rsync -av --progress --stats /hdd1/ /hdd2/ I would like to copy the ...
0
votes
2answers
661 views

Linux: Create mirror of directory, but ignore deletions

I would like to create a directory public_html/archive that is a mirror of public_html/images, except that deletions in the images directory don't cause corresponding deletions in archive. I was ...
7
votes
3answers
7k views

How to set default permissions for files moved or copied to a directory?

My question is similar to How to set the default file permissions on ALL newly created files in linux - but differs in important ways: I want all files created in (or copied to or moved to) a certain ...
2
votes
2answers
1k views

What is the standard place for static library files on Unix/Ubuntu

I am trying to install a library manually, well actually just put it in a sensible location preferably in my lib path. I have a lib[...].a file and a bunch of headers pertaining to that static ...
2
votes
2answers
370 views

Create directories

Is there an easy way to create all subdirectories of a path in linux ? Something like mkdir /a/b/c/d/e/f executed in / should create directories a,b,c,d,e,f
2
votes
2answers
6k views

How to specify download directory in Linux?

I am new to Linux, running Fedora 13. If installing from source, how do I specify the directory into which I want to download the file? I have a Download directory set up in my home directory but ...
2
votes
1answer
6k views

Removing a very large folder (~40GB) with lots of files efficiently in linux

I'd like to remove a folder with lots of files (namely millions of) efficiently. When I issue rm -rf folder/ it takes hours and I have to kill it. I'm wondering whether there is a magical way of doing ...
2
votes
2answers
9k views

Unix - List all directories and subdirectories, excluding directories without files

I would like to list all the directories and sub directories in and below the current path. Since I only wanted to display directories I came up with the follwing command: find -type d -exec ls -d1 ...
2
votes
2answers
2k views

Rename Linux home folder structure to system language

I have installed the Ubuntu distro first in Portuguese. Then, I decided I wanted the English language. I would like that the default folders like "Desktop" and "Documents" were renamed to this names, ...
4
votes
2answers
2k views

Using “find” to list only directories with no more childs

How can only directories be listed, that do not have another child directory? Imagine a structure like /A /A/AA /A/AB /A/AB/ABB /B /C /C/CC /C/CC/CCC /C/CC/CCC/CCCC I would like to use find to list ...
1
vote
2answers
3k views

Unix recursive directory listing with full pathname of file and filesize

I'm trying list all files (recursively) with their full path name (including name of the file) followed by their size in bytes. I do not need any '.', '..' entries. I dont think anything in the 'ls' ...
1
vote
2answers
700 views

linux: location of folders shared between group

What's the best location for a folder intended to be used as a group storage location? In other words, I want a folder called "examplefolder" belonging to a group named "examplegroup" that can be ...
3
votes
1answer
397 views

Check folder sizes and report combined size for identical named folders in Linux

I have 2 folders that have subfolders (named after users), most subfolders exists in both folders, but not all. Now I want to create a list of space used by each user. I can use the following command ...