Sponsored Content
Top Forums Shell Programming and Scripting Drilling down to the last subdirectory Post 302861359 by leepet on Tuesday 8th of October 2013 05:31:44 PM
Old 10-08-2013
Thanks, unfortunately, I don't know perl. However, I'll definitely play with what you posted.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

subdirectory password

Hi! I am a user of a workstation. I have got my own previlages on my system. Still I would like to have a security for my data. Can I set password or write a script that the entry to a particular subdirectiry is restricted?:confused: (1 Reply)
Discussion started by: sskb
1 Replies

2. UNIX for Dummies Questions & Answers

How can I copy files and subdirectory?

I am trying to copy some files from one location to another and I need to write a script to move all the files and the subdirectories to the new location (both unix), but excluding the temp directory. i.e., I want to avoid copying my temp subdirectories during the process of copying other files... (3 Replies)
Discussion started by: odogbolu98
3 Replies

3. Shell Programming and Scripting

Comparing subdirectory names

I am trying to reformat data from one private directory and reformat it and move it to a public one, but i only want to get directories that have not already been moved to the public directory. Here's what i'm working with Dir1 contains folders for each named with timestamp 20090320081302... (2 Replies)
Discussion started by: dabombace
2 Replies

4. Shell Programming and Scripting

Regex to remove subdirectory

I need to remove subdirectories that are empty and I've not done this before. First I am going through the files to remove old records. Then if the directory is empty I want to delete it. There are files in /direcotry/images/fs* - 0-9 and a-z The fs* directories need to stay, but any directories... (4 Replies)
Discussion started by: janel10
4 Replies

5. Shell Programming and Scripting

How to list directory and subdirectory?

Hi, I want to list all the directory and subdirectories under any directory. For eg. i am in a directory called A and want to check all directories under A. Output should be as below. /A /A/a1 /A/a1/a2 /A/b1 /A/c1/c2 A,a1,a2,b1,c1 and c2 all are directories.Just for Eg. Please... (7 Replies)
Discussion started by: anshu ranjan
7 Replies

6. Shell Programming and Scripting

Pick one file from each subdirectory

Hi, I have a problem I am trying to solve with bash. I need to search in a file system (data base) with hundreds of directories and thousands of subdirectories and millions of files. The files have a specific format with a header that gives the properties. Directories are organized so... (1 Reply)
Discussion started by: majest
1 Replies

7. UNIX for Dummies Questions & Answers

How to Find files in subdirectory?

I am trying to find all DAT files in a subdirectory named IN. I do not know the entire path. For example: /stage/<?>/<?>/IN/file.DAT I am using the find command without success: find /stage -name IN -a -name '*.DAT' -print What is the correct logic and syntax? Thank you for the help. (5 Replies)
Discussion started by: TwinGT
5 Replies

8. Shell Programming and Scripting

Should be a simple subdirectory check

Ok. Just getting back into PERL and probably (or most definitely) making a mountain out of a mole hill. I'm trying to see if a subdirectory exists, and if not, print the slightly modified path of the missing sub to a file. Sounds simple enough. Well here is my elaborate code. Save the... (2 Replies)
Discussion started by: luvdairish
2 Replies

9. UNIX for Advanced & Expert Users

Selective rsync to a subdirectory

I have a directory which has a collection of directories. I want to transfer all directories starting with `a` through `e` to the directory `ae`. What would be the command to achieve this? (0 Replies)
Discussion started by: kristinu
0 Replies

10. Shell Programming and Scripting

How to move to the last subdirectory one by one?

Hi, How can i traverse to the last subfolder in all the directories. eg: i have the below folders structure f1/sf1/r1 f2/sf2/r2 f3/sf3/r3/r4 i need to move to the last directory in each directory. Can anyone tell me a solution for this? I saw an example that does that. find . -type... (2 Replies)
Discussion started by: Little
2 Replies
SYSFS(5)						     Linux Programmer's Manual							  SYSFS(5)

NAME
sysfs - a filesystem for exporting kernel objects DESCRIPTION
The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures. (More precisely, the files and directo- ries in sysfs provide a view of the kobject structures defined internally within the kernel.) The files under sysfs provide information about devices, kernel modules, filesystems, and other kernel components. The sysfs filesystem is commonly mounted at /sys. Typically, it is mounted automatically by the system, but it can also be mounted manu- ally using a command such as: mount -t sysfs sysfs /sys Many of the files in the sysfs filesystem are read-only, but some files are writable, allowing kernel variables to be changed. To avoid redundancy, symbolic links are heavily used to connect entries across the filesystem tree. Files and directories The following list describes some of the files and directories under the /sys hierarchy. /sys/block This subdirectory contains one symbolic link for each block device that has been discovered on the system. The symbolic links point to corresponding directories under /sys/devices. /sys/bus This directory contains one subdirectory for each of the bus types in the kernel. Inside each of these directories are two subdi- rectories: devices This subdirectory contains symbolic links to entries in /sys/devices that correspond to the devices discovered on this bus. drivers This subdirectory contains one subdirectory for each device driver that is loaded on this bus. /sys/class This subdirectory contains a single layer of further subdirectories for each of the device classes that have been registered on the system (e.g., terminals, network devices, block devices, graphics devices, sound devices, and so on). Inside each of these subdi- rectories are symbolic links for each of the devices in this class. These symbolic links refer to entries in the /sys/devices directory. /sys/class/net Each of the entries in this directory is a symbolic link representing one of the real or virtual networking devices that are visible in the network namespace of the process that is accessing the directory. Each of these symbolic links refers to entries in the /sys/devices directory. /sys/dev This directory contains two subdirectories block/ and char/, corresponding, respectively, to the block and character devices on the system. Inside each of these subdirectories are symbolic links with names of the form major-ID:minor-ID, where the ID values corre- spond to the major and minor ID of a specific device. Each symbolic link points to the sysfs directory for a device. The symbolic links inside /sys/dev thus provide an easy way to look up the sysfs interface using the device IDs returned by a call to stat(2) (or similar). The following shell session shows an example from /sys/dev: $ stat -c "%t %T" /dev/null 1 3 $ readlink /sys/dev/char/1:3 ../../devices/virtual/mem/null $ ls -Fd /sys/devices/virtual/mem/null /sys/devices/virtual/mem/null/ $ ls -d1 /sys/devices/virtual/mem/null/* /sys/devices/virtual/mem/null/dev /sys/devices/virtual/mem/null/power/ /sys/devices/virtual/mem/null/subsystem@ /sys/devices/virtual/mem/null/uevent /sys/devices This is a directory that contains a filesystem representation of the kernel device tree, which is a hierarchy of device structures within the kernel. /sys/firmware This subdirectory contains interfaces for viewing and manipulating firmware-specific objects and attributes. /sys/fs This directory contains subdirectories for some filesystems. A filesystem will have a subdirectory here only if it chose to explic- itly create the subdirectory. /sys/fs/cgroup This directory conventionally is used as a mount point for a tmpfs(5) filesystem containing mount points for cgroups(7) filesystems. /sys/fs/smackfs The directory contains configuration files for the SMACK LSM. See the kernel source file Documentation/admin-guide/LSM/Smack.rst. /sys/hypervisor [To be documented] /sys/kernel This subdirectory contains various files and subdirectories that provide information about the running kernel. /sys/kernel/cgroup/ For information about the files in this directory, see cgroups(7). /sys/kernel/debug/tracing Mount point for the tracefs filesystem used by the kernel's ftrace facility. (For information on ftrace, see the kernel source file Documentation/trace/ftrace.txt.) /sys/kernel/mm This subdirectory contains various files and subdirectories that provide information about the kernel's memory management subsystem. /sys/kernel/mm/hugepages This subdirectory contains one subdirectory for each of the huge page sizes that the system supports. The subdirectory name indi- cates the huge page size (e.g., hugepages-2048kB). Within each of these subdirectories is a set of files that can be used to view and (in some cases) change settings associated with that huge page size. For further information, see the kernel source file Docu- mentation/admin-guide/mm/hugetlbpage.rst. /sys/module This subdirectory contains one subdirectory for each module that is loaded into the kernel. The name of each directory is the name of the module. In each of the subdirectories, there may be following files: coresize [to be documented] initsize [to be documented] initstate [to be documented] refcnt [to be documented] srcversion [to be documented] taint [to be documented] uevent [to be documented] version [to be documented] In each of the subdirectories, there may be following subdirectories: drivers [To be documented] holders [To be documented] notes [To be documented] parameters This directory contains one file for each module parameter, with each file containing the value of the corresponding parame- ter. Some of these files are writable, allowing the sections This subdirectories contains files with information about module sections. This information is mainly used for debugging. [To be documented] /sys/power [To be documented] VERSIONS
The sysfs filesystem first appeared in Linux 2.6.0. CONFORMING TO
The sysfs filesystem is Linux-specific. NOTES
This manual page is incomplete, possibly inaccurate, and is the kind of thing that needs to be updated very often. SEE ALSO
proc(5), udev(7) P. Mochel. (2005). The sysfs filesystem. Proceedings of the 2005 Ottawa Linux Symposium. The kernel source file Documentation/filesystems/sysfs.txt and various other files in Documentation/ABI and Documentation/*/sysfs.txt Linux 2018-04-30 SYSFS(5)
All times are GMT -4. The time now is 08:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy