from small one page howto to huge articles all in one place
 

search text in:





Poll
Which kernel version do you use?





poll results

Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

194569

userrating:

average rating: 1.7 (102 votes) (1=very good 6=terrible)


May 25th. 2007:
Words

486

Views

251893

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

140716

userrating:

average rating: 1.4 (42 votes) (1=very good 6=terrible)


April, 26th. 2006:

Druckversion . pdf icon
You are here: System->Tips and Tricks

Using the file command

This tip demonstrates the use of the file command. This command has been in UNIX since at least 1973 but is often overlooked. However, it's an extremely useful command for classifying files.

The file command is provided by the package sys-apps/file, so if you don't already have it installed, you'll need to type emerge file. Chances are you've already got it on your system though. To use file simply type file filename and you'll see information about the filename you passed in. Simple right?

Code Listing 1: Using file

% file css current.xml tips-20031117.xml tips-20031117.html screenlog.0 
css: directory
current.xml: symbolic link to `tips-20031117.xml'
tips-20031117.xml: ASCII English text
tips-20031117.html: UTF-8 Unicode HTML document text, with very long lines
screenlog.0: ASCII English text, with CRLF, CR line terminators,
with escape sequences, with overstriking

// You can also use file to look at shell scripts
% file bin/fix bin/update_dat.sh
bin/fix: a /usr/bin/perl -w script text executable
bin/update_dat.sh: a /bin/sh script text executable

// Or you can check binary files
% file /bin/cp
/bin/cp: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.4.1, dynamically linked (uses shared libs), stripped

// As the last example, you can use it on 'core' files
% file core
core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style,
SVR4-style, from 'a.out'

This should get you started but there are many other uses of file, see the man page (man 1 file) for more information.

From http://www.gentoo.org/news/en/gwn/20031117-newsletter.xml


rate this article:
current rating: average rating: 1.3 (45 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 48.3 ms