Soft Link

Hello everyone!
I wonder if you can help me with the following:
If you have the following directory and subdirectories,
UDIR1 ---MAIN DIRECTORY
under UDIR1 there is two subdirectories: UDIR11 AND UDIR12
under UDIR11 there is a subdirectory: UDIR111
under UDIR12 there are two subdirectories: UDIR121 and UDIR122
Given the above scenario:
1- How to create a soft link of the directory UDIR111 under the directory UDIR12, and then how do you name the soft link UDIR111-sl

Thanks so muchhhhhhhhhh to anyone who can help!!

Regards,
Carlos


Similar Content



Chmod Command

Hello everyone!

Can anyone help me in how to work the chmod command?
Suppose that you have a directory of udir12, a subdirectory udir121 (under udir12) and a file called file131 under directory udir121.

How do you change permission for the directory udir12 and all subdirectory and files to 770?

Can anyone help me out please!!!

Thanks
Carlos

Script To Recursively Enter Subdirectories And Rename Files Sequentially From Scratch

I am new to Bash scripting.

I have a main directory called Photos which has many subdirectories like People, Places and Things. Each of these subdirectories is populated by other subdirectories and lots of JPG photo images.

The digital cameras name the files in a way that is difficult to manage with web hosting.

I would like to go to each directory and subdirectory and rename the photos 1.jpg, 2.jpg, 3.jpg, etc. so that I can use a simple XML template to access them by specifying only a hosting directory.

I tried to use the following script:

#! /bin/bash

cd /home/paul/test

find . -name "*.jpg" -print0 | rename -v 's/.+/our $i; sprintf("%d.jpg", 1+$i++)/e' * -vn

exit 0

It successfully renames all of the files in all of the directories, but it does not restart the numbering for each new subdirectory. So first it goes through Photos and renames the three JPG files there 1.jpg, 2.jpg and 3. jpg, and then it opens the first subdirectory People and names the three JPG files there 4.jpg, 5.jpg and 6.jpg. Next it moves to the next subdirectory and continues sequential renaming until it is done.

I want it to restart sequential renaming with each new subdirectory, so that after renaming the three JPG files in Photos to 1.jpg, 2.jpg and 3.jpg, it moves to the first subdirectory and renames the JPG files there starting with 1.jpg again.

That way I use the links 1.jpg, 2.jpg, 3.jpg, etc in the XML template and just change the directory name to download the photos from the web.

Thanks for any help you can give me.

Do You Have To Have Execute On A Directory To Be Able To View Contents In It?

hi guys im a little confused

read privilege on a directory means i can list the contents
write means i can save,edit and delete files in that directory
but then it says execute is like a light switch,if its off (no execute) you will not be able to view items in the directory

so do you have to have rwx on a directory to be able to use it fully?
if you have rw- as the owner will you not be able to view or change
into subdirectories within that directory?

How Do I Know If A File Has A Hard Link To It?

ok I know when I create a soft link, it shows a ----> in a long listing and is colored (if ls --color) in aqua.

But hard links don't do this. How can I tell if a file/dir has a hard link to it or if it points to another file?

Can Someone Please Help Me Build A Script?

I'm in the need of building a script to clean up my media library. I've been PVR'ing for years now and it's time to clean things up. For example, my TV Shows are saved as such:

/media/storage/Show Name/Season 1/Show Name - S01E01 - Episode Name.mp4

Over the years I've created a bunch of subdirectories further than that and I want to go through and clean those out. For example, the following directory might exist:

/media/storage/Show Name/Season 1/subtitles

If I use the find command, with -type d and -maxdepth 4, I have discovered that the subdirectory I want to delete is in the 4th level. There should be nothing valid in the 4th level and okay to delete.

I don't really know where to start. I tried using the find command with -mindepth 4 but that doesn't seem to work as I would expect. Basically, I want to scan through the library, then I want to test to make sure that the directory isn't "Season XX" and if it is a subdirectory within Season X then I would like to delete that subdirectory.

Any ideas how I can accomplish this?

FYI: I'm using Korrora 21 with BASH.

The Behaviour Of Single & Double Quotes In Writing & Running Aliases?

This isn't a problem, more a how or a why:

I have always written an alias (alias ln="ln -sv") which changes the instruction for a "hard" link into one for a "soft". This worked fine until I needed a hard link, so, as part of the alias, I decided to give myself a reminder of what I was doing. After a bit of a struggle, I ended up with this (which I stuffed into my .bash_aliases file):

alias ln="echo -e 'Symbolic (soft) Link (use \033[1;36mhln\033[0m for Hard Link)\nuse \033[1;36m-f\033[0m for force'; ln -sv "

and it works:

Symbolic (soft) Link (use hln for Hard Link )
use -f for force
ln: missing file operand
Try 'ln --help' for more information.

(OK, no operand was supplied here, but the stuff we're talking about works fine).

Recently, however, I needed to look at the construction of the alias, ran "alias ln" & got:

alias ln='echo -e '\''Symbolic (soft) Link (use \033[1;36mhln\033[0m for Hard Link)\nuse \033[1;36m-f\033[0m for force'\''; ln -sv'

Now, I can (sort of) understand the logic of what's going on here, but not entirely - viz:

..1...'...............Open 'protected' mode (was double quote)
........echo -e....Command: invoke "echo -e"
..2...'...............matches 1: Closes 'protected' mode
........\.............invoke newline(\)? Or is this simply an scape character? (Yes it is see http://www.linuxquestions.org/questi...-quote-861714/)
..3...'...............Reopen 'protected' mode (or an escaped single quote - if so why?)
..4...'...............0pens 'protected' mode for "message" code
........Symbolic (soft) Link (use \033[1;36mhln\033[0m for Hard
........Link)\nuse \033[1;36m-f\033[0m for force
..5...'...............5 matches 4 (closes message code),
........\.............invoke newline(\) - or see above
..6...'...............6 matches 3 & closes the section started @ 'reopen'
..7...'...............Reopens 'protected' mode
........; ln -sv......New command[ ; ], creates link
..8...'...............8 matches 7 - the end (or is it?)

I would guess that the "alias" command has some built built in function that does all this - I have saved the the modified version as an alias & it works fine - but although I have read the excellent post:

http://www.linuxquestions.org/questi...-quote-861714/

I don't understand why the system has both double & single quotes. I have always felt that as long as the command line was explained & demonstrated in simple language it was easier to work with that than any point & click system. I grew up with CPM, DOS, Qemm, Desqview, WP5.1, DbII and these were great programs with great (especially WP51) manuals - but, ahh! - those days have gone

Any suggestions gratefully received

dmk

Yum Local Install - Package And All Dependencies In Local Directory

I am trying to install tilp, a program for the link between a computer and a Texas Instruments calculator. I have downloaded all the packages to a local directory. I tried telling yum to install all the packages at the same time, though, the dependencies still fail to resolve (though they are all in the directory).

I don't know if it would be safe to force install without the dependencies (even though I would install them later).

Any help would be greatly appreciated
Thank you,
Luke P. Patmore

Linux Kernel Module Installation And Other Questions Related To Kernel Module Install

I have installed Linux 3.5 kernel and have compiled e2fsprogs as well. I have my own version of ext3 file system - lets say it is myfs. I have compiled myfs as well. Now I have few questions:

1.How to insert myfs module and where? When I do modprobe myfs (.ko file) it says module not found. When I simply do insmod myfs.ko it works but I am not sure where is it putting the .ko file. Also the displays I have added (on mkdir call) are not showing up (kernel debug level is also set to 8) when I try to create a directory in mounted folder

Makefile in myfs directory looks like this:

KERNEL_TREE ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

obj-m := iext3.o

iext3-objs := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
ioctl.o namei.o super.o symlink.o hash.o resize.o ext3_jbd.o \
xattr.o xattr_user.o xattr_trusted.o acl.o xattr_security.o icefs.o \
transaction.o commit.o recovery.o checkpoint.o revoke.o journal.o

all:
make -C $(KERNEL_TREE) M=$(PWD) modules

clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.markers *.order *.symvers

and I am compiling myfs from my own directory: /home/myname/soft/myfs.

Also, I don't see any ext2/ext3/ext4 directories in /lib/modules/linuxversion/kernel/fs/ -- not sure if this is right or wrong.

2.Mount is working fine. I can see myfs is mounted on /dev/sda3 by doing df -a. When I unmount It says - umount: /home/..../mnt: not mounted and then if I do df -a the file system is unmounted. This is strange as its unmounting but still throwing error.

Some Background: Directory where I have everything: /home/soft myfs/ mye2fs/ Linux-3.5/ mnt/

Step1: cd Linux-3.5 --> 1) make 2) make modules 3) make modules_install 4) make install 5) reboot

Step2: compile myfs (my version of ext3) and insert the myfs kernel module --> cd myfs/ --> make --> insmod myfs.ko

Step3: compiled mye2fs for mkfs

Step4: use mye2fs to create myfilesystem on a device --> mount --> test printk statements put under myfs modules

Using Gdb To Detect Segmentation Fault In Sh?

I am using scientific linux. In the directory user/project/Build, after I ran 'make' to compile and link all the cpp files,I had no problems. But then, when I went to directory user/run/run.sh, which runs the project binary in user/project/Build/bin/project, I get a segmentation fault error. In the directory user/run, I enter 'gdb' in the command prompt and get the message "*** No targets specified and no makefile found. Stop."

What am I supposed to do to detect the segmentation fault?

Connecting To Specific Directory With Filezilla

Hello, I have an embedded linux device. I can connect to the device and I can upload or download files. No problem with this. But, at first connection, I want to connect to "/" directory instead of "/root". In the device file system, there are files ssh_config and sshd_config under /etc/ssh directory. I think I have to do something with these files but I don't know what.

I don't exactly know what mean "/root" and "/" directories. I think that the real root directory is "/" directory which is empty but when I connect with filezilla, the "/root" directory is the default so I had to go back to / directory everytime.