Browsing all articles tagged with files
Feb
1

Common Linux Configuration Files

Every user who switches from Windows to Linux has the fear of editing configuration files using the command line interface (CLI). If you are one of those people, then I am here to guide you through the most common configuration files found in a Linux system. Please note that to be able to edit these files, you need to have knowledge in file editors such as vim or pico.

/etc/profile
System wide environment variables for all users.

/etc/fstab
List of devices and their associated mount points. Edit this file to add cdroms, DOS partitions and floppy drives at startup.

/etc/motd
Message of the day broadcast to all users at login.

/etc/rc.d/rc.local
Bash script that is executed at the end of login process. Similar to autoexec.bat in DOS.

/etc/hostname
Contains full hostname including domain.

/etc/cron.*
There are 4 directories that automatically execute all scripts within the directory at intervals of hour, day, week or month.

/etc/hosts
A list of all know host names and IP addresses on the machine.

/etc/httpd/conf
Parameters for the Apache web server

/etc/inittab
Specifies the run level that the machine should boot into.

/etc/resolv.conf
Defines IP addresses of DNS servers.

Nov
18

Tip: Using find Command in Linux

Author Rai    Category Linux     Tags , , , , ,

Doing command-line stuff in Linux is fun. It may be intimidating for some at first, now that we are in the age where GUI is no longer an option. But with CLI, we can do so many things that can be accomplished faster if we know how to utilize the features of a certain command.

One command that is very flexible is find. With find, you can search not only based on filenames, you can also use other identifiers like GUI and UID, timestamps and file types.

Here are some examples of find commands:

This command will find all files in /home directory with .doc as extension and was modified 24 hours ago:

find /home -name *.doc -mtime 1

This one will find the same files, but not directories, and delete them using -exec option (great for disk usage maintenance, but BACKUP first!):

find /home -name *.doc -type f -mtime 1 -exec rm ’{}’ \;

You can also find files owned by a certain UID:

find /tmp -user johndoe find /tmp -uid 502

Or by GID:

find /home/development -gid 1000

You can also search for files and directories with certain permissions:

find . -perm -777

And from those examples, you can build your own command to find what you are looking for.

Aug
17

Tip: Hiding Files Inside An Image in Linux

I have a previous post on how to hide files inside an image file in Windows. If you have not read or watched the video yet, it is right here.

Anyway, a comment on that post gave a tip on how to do the same thing on Linux. Of course I tried it and it worked! According to Sebastian of mathemaniac.org, the concept here is really simple. An image file like JPG is read from the beginning of the file and terminated with an ‘End of Image’ marker. An archive file like ZIP has their metadata stored at the end of the file. Put them together and the image will be read as a valid image file and the appended ZIP file will be read as an archive.

Here is how to do it in Linux:

Get an image file and an archive of the files that you want to hide. In this example, I have cat beer_and_cig.jpg and hideme.zip file. The zip file contains an MP3 song that I have stored inside the archive. To create the archive-image file, run this command:

cat beer_and_cig.jpg hideme.zip > ucantseeme.jpg

What this does is the ‘cat‘ command reads the image file first, then reads the zip file and puts them together in the file named ucantseeme.jpg.

To test the integrity of the image file, try this:

# unzip -t ucantseeme.jpg
Archive: ucantseeme.jpg
warning [ucantseeme.jpg]: 4751 extra bytes at beginning or within zipfile
(attempting to process anyway)
testing: Feist - 09 - One Two Three Four.mp3 OK
No errors detected in compressed data of ucantseeme.jpg.

Notice the warning message? The test saw that there were few bytes at the beginning, which means it saw the image file first but the archive is intact and no errors were found.

Perfect!

Powered by 1and1.comGlobat Webhosting Earn with Your BlogAdvertise @ PinoyTux

Search PinoyTux

Subscribe to Email Feeds

Enter Email Address:

Blog Lounge

Popular Posts

Recent Posts

Drop your Card Here

Recent Comments

Site Stats