Click here for "Error Codes for Commercial Air Conditioners".(Japanese Version)

nuy

Directory and file operations

Check the number of characters and lines in a file

The wc command is used to check the number of characters and lines in a file. To check the number of characters, use "-c" as an option, and to check the number of lines, use "-l". To execute the wc command, specify the name of the file you want to investigate as an argument.
Directory and file operations

Display the contents of a file with line numbers

To display the contents of a file, use the cat command, but if you run it without options, it will simply display the contents. To display the contents of a file with line numbers, run the cat command with the option '-n'. If you don't want to add line numbers to blank lines in the file, add the option "-b".
Directory and file operations

Create an empty file (zero bytes)

To create an empty file, use the touch command, which changes the type stamp of a file, but creates a zero-byte file if the argument is a non-existent file.
Directory and file operations

Search files for strings

Use the find command to search for files that exist in your Linux system. find <Directory name> <Option> <File name> Set each argument to a value and perform the search. The directory name is the name of the directory from which the file search will be performed. The find command searches the specified directory and all subdirectories below it.(An error will occur if you search for a directory that cannot be referenced with permissions.) option allows you to specify what files to search. For example, you can search only for directories, or only for files that belong to a certain owner.
Directory and file operations

Compressed in GZIP format, GZIP format decompression

GZIP is the most commonly used compression method for files on Linux. It is usually used to reduce the size of a file by compressing it into a single (archived) file using the tar command.
Directory and file operations

Name your files with dates etc.

Name your files with dates etc. The command to append a date to a file name is the 'date' command. ●How to use the date command $ date 2020 Septembe 23 Wednesday 00:11:21 JST ---------------------------------------------------------- The date is now displayed. Now run it as follows ---------------------------------------------------------- $ date +%Y%m%d 20200923 -------------------------
Directory and file operations

Search for and delete specific files

The find command can be used to search for and remove files that have certain things in common. The arguments are the directory to be searched, the criteria for the files to be searched, the -ok option or the -exec option, and the delete command rm.
Directory and file operations

Deleting files that cannot be normally deleted on Linux

To delete a file, run the rm command. However, files whose names begin with "-" or contain spaces or metacharacters (meta-characters) cannot be deleted because the shell cannot recognize them correctly. However, in Windows and MacOS, files and directories can be created, so if a file is shared or uploaded, a file with such a name may exist in Linux. In this case, if the name contains a hyphen "--", you can either delete the file by adding the "--" option to the rm command and specifying the file containing the hyphen as an argument, or you can prefix the file name with". /" at the beginning of the file name to delete it. Files containing spaces can be removed by enclosing the file name in quotation marks '' or double quotation marks "", or by prefixing the space with an escape sequence.
Directory and file operations

Converting image file formats on Linux

In Linux, there is an image format conversion command, convert command. The convert command is part of the "ImageMagick" package and allows you to perform a variety of image conversions with the command. To run the convert command, specify the file to be converted and the file to be converted as arguments. The file format is automatically determined by the extension included in the file name.
Directory and file operations

Editing image format files on Linux

●Rotate the image The Linux convert command can be used to rotate images. To rotate an image, add the "-rotate" option to the convert command and specify the rotation angle as an argument. ●Enlarge or reduce the image To scale an image file, use the convert command with the "-geometry" option. You can specify the width and height as arguments, but if you want to scale the image while keeping the aspect ratio, you can specify the ratio as "%".
Directory and file operations

Sorting files

●Sort by increasing file size. When viewing the files in a directory, they are usually displayed in alphabetical order by file name. However, it is possible to display the desired files and directories in size order. In this case, you can run the ls command with the option "-S" to display the files in order of increasing file size. The "-S" option is an uppercase S.
Directory and file operations

Various ways to view files

●Displays the number of files in a directory The ls command allows you to view files in the current directory or in a specific directory. It can also tell you the number of files instead of the file or directory name. In such a case, you can get the number of files by using the find command, which is a file search command, together with the wc command, which does the counting Use the find command with the directory you want to count as an option, the file type with the "-type" option, and then use the pipe "|" to count the number of lines with the wc command with the "-l" option to display the number.
Directory and file operations

File comparison

●Compare two files To see if there is a difference between the two files, use the "cmp" command. Specify the file you want to compare as an argument and run it. If there is a difference, it will print the byte position and line number. Also, if there is no difference, the cmp command will not display any message, only a prompt.
Directory and file operations

Extraction of strings and lines in a file

●Extract strings that start with a specific character If you want to extract a specific string from a long file, use the grep command. By specifying the string to be extracted and the file as the arguments of the grep command, and by adding "^" (carrot) as an additional condition to extract data starting from a specific string, you can extract data starting from that string.
Directory and file operations

File manipulation with tar command

●View the contents of the archive created by the tar command To view the contents of an archive created by the tar command, run the tar command with the "t" option. If you have saved the file as a file, use the "f" option together. If the "v" option is not used, only the names of the files included in the archive will be displayed; if it is used, detailed information such as the attributes of each file will be displayed. ※The tar command can omit the "-" (hyphen) option specification.