You can use the chattr command to change file attributes in Linux. You can secure your files by modifying their attributes. For example, you can protect important system files by making them undeletable.
The attrib command displays or changes the file attributes for a file or folder. It's run from the Command Prompt in all versions of Windows.
The mkdir (make directory) command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, Windows and ReactOS, the command is often abbreviated to md .
In
Linux there are basically three
types of files: Ordinary/Regular
files. Special
files. Directories.
Ordinary/Regular Files
- Readable files.
- Binary files.
- Image files.
- Compressed files and so on.
For example, your USB flash drive is detected as Removable Disk (F:), so it is "F". Go back to the Command prompt and then type "F:" without the quotes, then hit enter. Now, type-in "attrib -s -h -r /s /d" without the quotes and then enter. You can now view the hidden files on your USB flash drive.
Open File Explorer and go to the folder that contains your files. Select the file whose attributes you want to change. On the Home tab of the Ribbon, click on the Properties button. In the next dialog, under Attributes, you can set or remove the Read-only and Hidden attributes.
Archive Attribute is an attribute of files and folders that, when marked or set by the Microsoft Windows NT Backup program, indicates that the file or folder has been backed up. Then, when the backup program is run again if the archive bit is still set, the file is not backed up because it has not been modified.
In Linux, you can easily change the file permissions by right-clicking the file or folder and then selecting “Properties.” This will open a “Permission” tab where you can change the file permissions. In short, “chmod 777” means making the file readable, writable and executable by everyone.
An attribute is defined as a quality or characteristic of a person, place, or thing. There is a difference between attributes and traits, but it is slight and some characteristics could be considered either an attribute or a trait.
To change directory permissions in Linux, use the following:
- chmod +rwx filename to add permissions.
- chmod -rwx directoryname to remove permissions.
- chmod +x filename to allow executable permissions.
- chmod -wx filename to take out write and executable permissions.
Following are some of the attributes of a file :
- Name . It is the only information which is in human-readable form.
- Identifier. The file is identified by a unique tag(number) within file system.
- Type.
- Location.
- Size.
- Protection.
- Time, date, and user identification.
Read-Only (R) : Read-Only attribute will prevent software programs from saving changes to a file. This is useful if you want to write protect a file. Note that a Read-Only file will not prevent it from being deleted.
Listing files by nameThe easiest way to list files by name is simply to list them using the ls command. Listing files by name (alphanumeric order) is, after all, the default. You can choose the ls (no details) or ls -l (lots of details) to determine your view.
which command in Linux is a command which is used to locate the executable file associated with the given command by searching it in the path environment variable. It has 3 return status as follows: 0 : If all specified commands are found and executable.
In Linux, ./ refers to the current directory. Let's take an example. You open up your command prompt because you are huge console junky and you would rather use emacs, a text editor for the console, than a graphic word processor. So you open up the terminal, where you are, by default, placed in the home directory.
How to do it: If it's a file in a folder, change the view to Details and look at the size. If not, try right-clicking on it and selecting Properties. You should see a size measured in KB, MB or GB.
The du command is a standard Linux/Unix command that allows a user to gain disk usage information quickly. It is best applied to specific directories and allows many variations for customizing the output to meet your needs. As with most commands, the user can take advantage of many options or flags.
- How much space do I have free on my Linux drive?
- You can check your disk space simply by opening a terminal window and entering the following: df.
- You can display disk usage in a more human-readable format by adding the –h option: df –h.
- The df command can be used to display a specific file system: df –h /dev/sda2.