Tag Info

Hot answers tagged

13

Use find to select the directories and wc to count them. find <directory> -mindepth 1 -type d | wc -l


7

If you're installing X or Y, and it's not a standard OS package, then stuff should end up in /usr/local/bin, /usr/local/lib/, etc. The Filesystem Hierarchy Standard and Linux Standard Base is probably a good place to start if you want to reference the closest thing there is to a standard list.


6

Microsoft added Symlink support in Windows Vista, which should work here. You'll need to use the mklink command line tool to do this: MKLINK [[/D] | [/H] | [/J]] Link Target /D - Creates a directory symbolic link. Default to file symbolic link. /H - Creates a hard link instead of a symbolic link. /J - Creates a Directory Junction. Link - Specifies the new ...


6

I have to give Kyle Brandt complete credit above. So, if you like this answer below, click the Up triangle on his post to lift his status, please. However, I improved upon his routine and felt it my duty to post it here and mark it as the final answer. All I added to Kyle's routine was ensure that we're only touching the home dir, thus the line with the ...


5

This is well defined by the File System Hierarchy Standard (FHS). Wikipedia Link FHS Website


5

#!/bin/bash for f in $( ls /home/ ); do chown -R $f:yourgroup /home/$f done There is no sanity checking in this and I wrote it without any testing, so be careful. (BTW, the requirement of "no hidden files or folders" will be met by the fact that a hidden file in Unix is just a regular file with a . before it, and .username will not be a valid user for ...


5

I think the way you are asking is kind of backwards. You don't want to take each folder and then find the user, rather you want to take the user and find their home folder. #!/bin/bash while IFS=':' read -r login pass uid gid uname homedir comment; do echo chown $uid:$gid "$homedir"; done < /etc/passwd You will need to remove the echo of course ...


5

These directories are created by the windows update service. The service usually extracts the updates in the drive with the most free space. As far as I know you can safely remove the directories if you're able to. In most cases you can't just delete the directories because the permissions are wrong and you first have to set the correct permisisions.


5

You should consider leaving the existing structure intact, as links (and references to files and folders in existing documentation) will be invalidated if things get moved around. I'd recommend ghettoizing that whole tree into something like an /oldstuff folder, and use some indexing/searching software to build a search engine for it instead. You can ...


5

You can use: rm -r MYFOLDER/{.[^.],.??*} This deletes also the hidden files and folders. If you have too many files in the MYFOLDER directory, then you should run instead: ls MYFOLDER/{.[^.],.??*}|xargs rm -r


4

Each distro may have their own quirks, but the overall file system structure should be more or less the same: "Linux File Structure" is a good overview of the directory structure. "Linux's directory structure" is a bit more verbose and goes into more detail about their contents.


4

Erm...is this a trick question, it looks kinda straightforward? if not then perhaps try the following in a batchfile somewhere in your path; md _Documentation md _ProjectManagement md Releases md Source md Source\Trunk md Source\Trunk\Library md Source\Trunk\Projects md Source\Trunk\Tests Best of luck.


4

Server specifications are likely to be less of an issue than the file system you are using. Different file systems have different approaches to storing directory data. This will impact the scanning speed at various sizes. Another important consideration is the lifecycle of the files. If you have frequent addition and deletion of files you may want the ...


4

Don't put wildcards in the folder parameter. Put them in the path parameter. find /www -maxdepth 2 -path '*-aws/*' -exec cp -frt /www/mainhost/aws/awstatstotals/tmp/ {} +


3

Here you go: for /f %d in (listfiles) do md %d This makes a directory under the current directory for each line in a file called "listfiles" in the current directory. If you saved the file as a .txt file, make sure to reflect that in the command. for /f %d in (listfiles.txt) do md %d


3

One way is to open the list of names in word and do copy and replace. Replace ^p with ^pmkdir this will replace all carraige returns (^p) with a carriage return and the mkdir command. Then save it as a bat and run it. There's def a cleaner way to do this if its going to be used over and over, but this is quick quick.


3

WatchDISK does exactly that -- shows directory sizes over time. WatchDISK's big brother, PA Storage Monitor does that plus more (besides tracking just directory sizes, it can tell you who the largest storage users are, where the MP3s are, etc).


3

For your linux server you can use inotify-tools based on inotify. For your windows server I haven't a solution.


3

In Windows 7 (might be the same in vista), add the following to the search: type:"file folder" eg: searchterm type:"file folder"


3

I use /usr/local for stuff I put into the system, and I let third-party installers take /opt.


3

This might help #!/bin/bash for file in `ls -a | grep -v '^\.'` do if [[ -d $file ]] then fowner=`ls -ld $file | nawk '{print $3}'` fgroup=`ls -ld $file | nawk '{print $4}'` chown -R $fowner:$fgroup $file fi done


3

inotifywait will do recursive checks. It's in the Ubuntu repositories.


3

The perfect tool for this job is using the inotify kernel service. You can use them on a shell script with the package inotify-tools (debian/ubuntu). You can read more and see some examples on the project's page. There's even an example on the page that seems to do something close to what you want: #!/bin/sh # get the current path CURPATH=`pwd` ...


3

mv -v -f ${srcDir}${prefix}* -t $archiveDir in this case if you quote, * will be interpreted literally


3

To increase the security of your files you can put them in a directory outside the webroot, and then stream them to your webpages via a script. On top of this, the script that streams them has to be on an access controlled page. You can use .htaccess but I prefer a more flexible login system.


2

I had problem running the script from Windows Vista. When I ran the code nothing happend. I needed to be administrator to be able to run the script. When I right clicked on the .bat file and "run as administrator" it didn't work because it for some reason started in the system32 folder (if I remember correctly). To solve this simply use the Windows ...


2

This behaviour is called Link Tracking. If the files are on a different machine, I think you need to switch off the "Distributed Link Tracking client" service. If the Files are on the same machine, you can either ... Change the registry HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer add a DWORD value of 1 against value NoResolveTrack ...


2

there is a service called distributed link tracking server and client wich are responsible for the behaviour you are observing


2

In the Windows Explorer search pane make sure that More Advanced Options is expanded (not all versions of Windows require you to explicitly expand this). Find the drop down marked Type Of File (it's normally the first advanced option), and choose Folder. Your search results will now only include folders. Edit: If you've got the dog "helping" you search, ...



Only top voted, non community-wiki answers of a minimum length are eligible