Tag Info

Hot answers tagged

31

You don't. At least not just like that. The preceding line in the quoted document is of importance: Set up your prompt to do a pwd everytime you cd. Always do a cd . before doing anything. This way, you as the operator verify your current working dir before doing anything of importance, as it's printed out with each change. cd . doesn't make ...


27

Strangely enough /usr actually means Unix System Resources. "The "etc" in "/etc/bin" really does stand for "etcetera." In early Unix systems, the most important directory was the "bin" directory (short for "binaries" -- compiled programs), and "etc" was for trivial stuff like startup, shutdown and admin. The list of things you need for running Linux is: a ...


25

The switch you need is --parents eg: jim@prometheus:~$ cp --parents test/1/.moo test2/ jim@prometheus:~$ ls -la test2/ total 42 drwxr-xr-x 3 jim jim 72 2010-09-14 09:32 . drwxr-xr-x 356 jim jim 43136 2010-09-14 09:32 .. drwxr-xr-x 3 jim jim 72 2010-09-14 09:32 test jim@prometheus:~$ ls -la test2/test/1/.moo -rw-r--r-- 1 jim jim 0 2010-09-14 09:32 ...


22

So sorry, I should've RTFM ... http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.add.html You can add a directory without adding its contents: $ svn add --depth=empty otherdir A otherdir Edit: This doesn't work recursively though, is there any way to do that too?


20

(Note: ~ translates as /home/user in this post) Personally, I put all of my custom-made system scripts in /usr/local/bin and all of my personal bash scripts in ~/bin. Very few programs I install place themselves in /usr/local/bin directory so it's not very cluttered and it was already in the $PATH variable on most of my machines. To add /usr/local/bin to ...


19

For more data on the layout of Linux file-systems, look at the Filesystem Hierarchy Standard (now at version 2.3) http://www.pathname.com/fhs/ This explains the purpose of each directory, and even tells you what directory is best to install software into. For most distros, software that doesn't come with the distro probably should go into /usr/local/.


17

Whilst a major cause of this problem is ext3 performance with millions of files, the actual root cause of this problem is different. When a directory needs to be listed readdir() is called on the directory which yields a list of files. readdir is a posix call, but the real linux system call being used here is called 'getdents'. Getdents list directory ...


17

If the current working directory of your shell is removed, it is possible to lose data. For example, $ pwd /home/user/test $ rmdir /home/user/test $ pwd /home/user/test $ some_command | tee command.log tee: command.log: No such file or directory <long output> The output of some_command was not written to the disk. Typing cd . before running a ...


15

The data=writeback mount option deserves to be tried, in order to prevent journaling of the file system. This should be done only during the deletion time, there is a risk however if the server is being shutdown or rebooted during the delete operation. According to this page, Some applications show very significant speed improvement when it is used. For ...


15

You're looking for diff -rq (dir1) (dir2) Proof of concept: #!/bin/sh #create our test mkdir -p /tmp/a/b echo "test" >> /tmp/a/c mkdir -p /tmp/a/d/e echo "blah" >> /tmp/a/d/e/f #only exists here mkdir -p /tmp/q/b echo "testing" >> /tmp/q/c #/tmp/a/c shouldnt match mkdir -p /tmp/q/d/e echo "blah" >> /tmp/q/d/e/g #only exists here ...


14

This really depends on how you are going to restore your system. If you will rebuild then you only need the configuration/data files for your services (eg: /etc, /opt, /var, /home) If you are after a full system restore, then it you could omit /proc, /boot & /dev. Then you can install the minimum OS from your boot media and then restore your system via ...


14

One option is to use unionfs Unionfs: A Stackable Unification File System This project builds a stackable unification file system, which can appear to merge the contents of several directories (branches), while keeping their physical content separate. Unionfs is useful for unified source tree management, merged contents of split ...


14

That limit is per-directory, not for the whole filesystem, so you could work around it by further sub-dividing things. For instance instead of having all the user subdirectories in the same directory split them per the first two characters of the name so you have something like: top_level_dir |---aa | |---aardvark1 | |---aardvark2 |---da | |---dan | ...


13

If you're considering scripting it, it's always helpful to learn about the pushd and popd commands. Sometimes you can't be sure what drives letters are already used on the machine that the script will run on and you simply need to take the next available drive letter. Since net use will require you to specify the drive, you can simply use pushd ...


13

Historically, /etc stands for "etcetera" and /var is short for "variable." I suppose the former is because a large collection of unrelated system configuration files go into /etc. The latter is because the files in /var are expected to change. You can often mount /usr and / as read-only (except when performing updates), but you can never mount /var ...


13

There's only one kind of symbolic link. The issue you're seeing with FTP is probably that the FTP server is restricted to a subtree of the filesystem (this is called a chroot jail), and a symbolic link pointing outside that subtree won't work. That's by design: the chroot jail is for security, and you mustn't be able to escape the jail by following a ...


13

I think it's more important to show your current directory. On every linux server, I modify the prompt in /etc/bashrc by changing "W" to "w". [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " to [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \w]\\$ " The effect of this is: [root@xt include]# versus [root@xt ...


13

I know it's not the answer you're looking for, but I believe the correct solution is to avoid depending on the ordering of files in a directory. Maybe it's always consistent across all HFS+ filesystems, and maybe you could find a way to make it consistent in ext4 or some other filesystem as well, but it will cost you more trouble in the long run than it will ...


10

These days Microsoft is recommending that C:\ be no smaller than 32GB for R2 installs (the official word). Microsoft has gone to some lengths make installing new features Just Work without having to dig out install media. What's more, it keeps complete 'undo' history for system files, and Microsoft seems unimpressed by those of us who want to keep C:\Windows ...


10

There is no per directory file limit in ext3 just the filesystem inode limit (i think there is a limit on the number of subdirectories though). You may still have problems after removing the files. When a directory has millions of files, the directory entry itself becomes very large. The directory entry has to be scanned for every remove operation, and ...


10

To strip down the parent directory: tar zxvf latest.tar.gz --strip 1 If you want to be sure that nothing from the parent directory is extracted: tar zxvf latest.tar.gz --strip 1 wordpress/directories Edit: --strip (--strip-path or --strip-components) was introduced in tar 1.14.


9

Well, the standard solution for directories is LDAP. This is more a standard API and a storage backend than full-fledged application. In practice you set up an LDAP server (OpenLDAP being a popular choice), and then install applications which use LDAP internally to handle user's needs. For example, you can: authenticate against LDAP, e.g. : Linux logins, ...


9

Ask and ye shall receive: http://technet.microsoft.com/en-us/library/ee692796.aspx Counting the Number of Items in a Folder Well, what do you know: it looks like the sun is finally coming out, which means it’s almost time for us to go. Before we do, however, let’s show you one last little trick with the Get-ChildItem cmdlet. Sometimes ...


9

It depends on your filesystem. I'm going to assume it's ext4: The maximum number of files is global, not per directory, and it's determined by the number of inodes allocated when the filesystem was created. Try running the following command to see the number of inodes per filesystem. $ df -i Filesystem Inodes IUsed IFree IUse% Mounted on ...


8

This is what I have in my favourites for reference: http://blogs.technet.com/b/migreene/archive/2008/03/24/3019467.aspx CREATOR OWNER - Full Control (Apply onto: Subfolders and Files Only) System - Full Control (Apply onto: This Folder, Subfolders and Files) Domain Admins - Full Control (Apply onto: This Folder, Subfolders and Files) Everyone - Create ...


8

When you added yourself to the group, did you log out of your workstation and log back in? Security Group membership is a component of the access token granted to your user ID at logon and changing group membership requires a log out and log in order to get a new access token that reflects the new membership.


7

Websites should live in users' home directories. They're user data, should be isolated by one-user-per-site, and dynamic content should run as a separate user again, with files that the dynamic content needs to read and modify given the appropriate permissions to do so. Update: Just because it's not a shared hosting server doesn't mean that you shouldn't ...


7

If you are bound to ext2/ext3 the only possibility I see is to partition your data. Find a criterion that splits your data into manageable chunks of similar size. If it's only about the profile images I'd do: Use a hash (e.g SHA1) of the image Use the SHA1 as file and directory name For example the SQUID cache does it this way: f/4b/353ac7303854033 ...


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.



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