• Tistory
    • 태그
    • 위치로그
    • 방명록
    • 관리자
    • 글쓰기
Carousel 01
Carousel 02
Previous Next

'Programming/기타 etc.'에 해당되는 글 8건

  • 2023.08.24 [WSL2] 경로를 windows 탐색기에서 확인하자.
  • 2022.08.29 conda 사용중 "An HTTP error occurred" 가 발생할 경우
  • 2021.12.06 [Git] github -> gitlab / repository를 이사하자
  • 2021.11.30 [ROS] Rosbag2Video
  • 2021.04.13 float 값의 비교 (== 연산자는 위험하다!)
  • 2021.02.25 google drive web client 사용량 제한
  • 2019.03.18 pycharm 사용 및 환경설정 팁
  • 2015.12.17 폴더 내의 파일목록을 다뤄보자. 폴더 내 파일 리스트 만들기

[WSL2] 경로를 windows 탐색기에서 확인하자.

Programming/기타 etc. 2023. 8. 24. 13:38




wsl2 에서는 explorer.exe 명령어가 동작한다. 

파라미터로 경로를 입력하면 해당 경로가 파일 탐색기로 바로 열리기에 현재 경로를 파라미터로 넣어 바로 열수 있다.

 


explorer.exe .
저작자표시 (새창열림)

'Programming > 기타 etc.' 카테고리의 다른 글

conda 사용중 "An HTTP error occurred" 가 발생할 경우  (0) 2022.08.29
[Git] github -> gitlab / repository를 이사하자  (0) 2021.12.06
[ROS] Rosbag2Video  (0) 2021.11.30
float 값의 비교 (== 연산자는 위험하다!)  (0) 2021.04.13
google drive web client 사용량 제한  (0) 2021.02.25
블로그 이미지

매직블럭

작은 지식들 그리고 기억 한조각

,

conda 사용중 "An HTTP error occurred" 가 발생할 경우

Programming/기타 etc. 2022. 8. 29. 14:56




conda 사용 중 "An HTTP error occurred when trying to retrieve this URL" 에러가 발생할 경우
 
서버 접속이 차단되어 발생하는 문제라 함.
 
이럴 경우 config 를 수정하여 해결 가능.. 하다는데

$ conda config --set ssl_verify False

(내 경우는 이 방법으로 해결 안됨..해결 후 업데이트 예정.) 

 

저작자표시 (새창열림)

'Programming > 기타 etc.' 카테고리의 다른 글

[WSL2] 경로를 windows 탐색기에서 확인하자.  (0) 2023.08.24
[Git] github -> gitlab / repository를 이사하자  (0) 2021.12.06
[ROS] Rosbag2Video  (0) 2021.11.30
float 값의 비교 (== 연산자는 위험하다!)  (0) 2021.04.13
google drive web client 사용량 제한  (0) 2021.02.25
블로그 이미지

매직블럭

작은 지식들 그리고 기억 한조각

,

[Git] github -> gitlab / repository를 이사하자

Programming/기타 etc. 2021. 12. 6. 14:22




모종의 이유로 guthub 의 repository를 gitlab으로 옮겨야 할 경우가 있다

코드 clone 후 저장소 바꿔서 push 하는 방법도 있겠지만 더 간단한 방법이 있어서 정리

 


[1단계. github에서]

1. settings - Developer Settings - Personal access tokens

2. scrops 선택(repo 정도로 사용) 후 Generate Token

 

[2단계. gitlab에서]

1. New project - Import project - Github

2. Personal Access Token에 1의 token 붙여넣기 - List your Github repositories

3. list 중 필요한 repository 우측의 import 로 추가

저작자표시 (새창열림)

'Programming > 기타 etc.' 카테고리의 다른 글

[WSL2] 경로를 windows 탐색기에서 확인하자.  (0) 2023.08.24
conda 사용중 "An HTTP error occurred" 가 발생할 경우  (0) 2022.08.29
[ROS] Rosbag2Video  (0) 2021.11.30
float 값의 비교 (== 연산자는 위험하다!)  (0) 2021.04.13
google drive web client 사용량 제한  (0) 2021.02.25
블로그 이미지

매직블럭

작은 지식들 그리고 기억 한조각

,

[ROS] Rosbag2Video

Programming/기타 etc. 2021. 11. 30. 16:42




ROS 에서 녹화된 rosbag 파일 내의 비디오를 추출하는 코드

github에 쓰기 편하게 만들어 준 코드가 있어서 기록.

 

https://github.com/mlaiacker/rosbag2video

 

GitHub - mlaiacker/rosbag2video: converts image sequence in ros bag files to video files

converts image sequence in ros bag files to video files - GitHub - mlaiacker/rosbag2video: converts image sequence in ros bag files to video files

github.com

 

#!/usr/bin/env python3

"""
rosbag2video.py
rosbag to video file conversion tool
by Abel Gabor 2019
baquatelle@gmail.com
requirements:
sudo apt install python3-roslib python3-sensor-msgs python3-opencv ffmpeg
based on the tool by Maximilian Laiacker 2016
post@mlaiacker.de"""

import roslib
#roslib.load_manifest('rosbag')
import rospy
import rosbag
import sys, getopt
import os
from sensor_msgs.msg import CompressedImage
from sensor_msgs.msg import Image
import cv2

import numpy as np

import shlex, subprocess

MJPEG_VIDEO = 1
RAWIMAGE_VIDEO = 2
VIDEO_CONVERTER_TO_USE = "ffmpeg" # or you may want to use "avconv"

def print_help():
    print('rosbag2video.py [--fps 25] [--rate 1] [-o outputfile] [-v] [-s] [-t topic] bagfile1 [bagfile2] ...')
    print()
    print('Converts image sequence(s) in ros bag file(s) to video file(s) with fixed frame rate using',VIDEO_CONVERTER_TO_USE)
    print(VIDEO_CONVERTER_TO_USE,'needs to be installed!')
    print()
    print('--fps   Sets FPS value that is passed to',VIDEO_CONVERTER_TO_USE)
    print('        Default is 25.')
    print('-h      Displays this help.')
    print('--ofile (-o) sets output file name.')
    print('        If no output file name (-o) is given the filename \'<prefix><topic>.mp4\' is used and default output codec is h264.')
    print('        Multiple image topics are supported only when -o option is _not_ used.')
    print('        ',VIDEO_CONVERTER_TO_USE,' will guess the format according to given extension.')
    print('        Compressed and raw image messages are supported with mono8 and bgr8/rgb8/bggr8/rggb8 formats.')
    print('--rate  (-r) You may slow down or speed up the video.')
    print('        Default is 1.0, that keeps the original speed.')
    print('-s      Shows each and every image extracted from the rosbag file (cv_bride is needed).')
    print('--topic (-t) Only the images from topic "topic" are used for the video output.')
    print('-v      Verbose messages are displayed.')
    print('--prefix (-p) set a output file name prefix othervise \'bagfile1\' is used (if -o is not set).')
    print('--start Optional start time in seconds.')
    print('--end   Optional end time in seconds.')



class RosVideoWriter():
    def __init__(self, fps=25.0, rate=1.0, topic="", output_filename ="", display= False, verbose = False, start = rospy.Time(0), end = rospy.Time(sys.maxsize)):
        self.opt_topic = topic
        self.opt_out_file = output_filename
        self.opt_verbose = verbose
        self.opt_display_images = display
        self.opt_start = start
        self.opt_end = end
        self.rate = rate
        self.fps = fps
        self.opt_prefix= None
        self.t_first={}
        self.t_file={}
        self.t_video={}
        self.p_avconv = {}

    def parseArgs(self, args):
        opts, opt_files = getopt.getopt(args,"hsvr:o:t:p:",["fps=","rate=","ofile=","topic=","start=","end=","prefix="])
        for opt, arg in opts:
            if opt == '-h':
                print_help()
                sys.exit(0)
            elif opt == '-s':
                self.opt_display_images = True
            elif opt == '-v':
                self.opt_verbose = True
            elif opt in ("--fps"):
                self.fps = float(arg)
            elif opt in ("-r", "--rate"):
                self.rate = float(arg)
            elif opt in ("-o", "--ofile"):
                self.opt_out_file = arg
            elif opt in ("-t", "--topic"):
                self.opt_topic = arg
            elif opt in ("-p", "--prefix"):
                self.opt_prefix = arg
            elif opt in ("--start"):
                self.opt_start = rospy.Time(int(arg))
                if(self.opt_verbose):
                    print("starting at",self.opt_start.to_sec())
            elif opt in ("--end"):
                self.opt_end = rospy.Time(int(arg))
                if(self.opt_verbose):
                    print("ending at",self.opt_end.to_sec())
            else:
                print("opz:", opt,'arg:', arg)

        if (self.fps<=0):
            print("invalid fps", self.fps)
            self.fps = 1

        if (self.rate<=0):
            print("invalid rate", self.rate)
            self.rate = 1

        if(self.opt_verbose):
            print("using ",self.fps," FPS")
        return opt_files


    # filter messages using type or only the opic we whant from the 'topic' argument
    def filter_image_msgs(self, topic, datatype, md5sum, msg_def, header):
        if(datatype=="sensor_msgs/CompressedImage"):
            if (self.opt_topic != "" and self.opt_topic == topic) or self.opt_topic == "":
                print("############# COMPRESSED IMAGE  ######################")
                print(topic,' with datatype:', str(datatype))
                print()
                return True;

        if(datatype=="theora_image_transport/Packet"):
            if (self.opt_topic != "" and self.opt_topic == topic) or self.opt_topic == "":
                print(topic,' with datatype:', str(datatype))
                print('!!! theora is not supported, sorry !!!')
                return False;

        if(datatype=="sensor_msgs/Image"):
            if (self.opt_topic != "" and self.opt_topic == topic) or self.opt_topic == "":
                print("############# UNCOMPRESSED IMAGE ######################")
                print(topic,' with datatype:', str(datatype))
                print()
                return True;

        return False;


    def write_output_video(self, msg, topic, t, video_fmt, pix_fmt = ""):
        # no data in this topic
        if len(msg.data) == 0 :
            return
        # initiate data for this topic
        if not topic in self.t_first :
            self.t_first[topic] = t # timestamp of first image for this topic
            self.t_video[topic] = 0
            self.t_file[topic] = 0
        # if multiple streams of images will start at different times the resulting video files will not be in sync
        # current offset time we are in the bag file
        self.t_file[topic] = (t-self.t_first[topic]).to_sec()
        # fill video file up with images until we reache the current offset from the beginning of the bag file
        while self.t_video[topic] < self.t_file[topic]/self.rate :
            if not topic in self.p_avconv:
                # we have to start a new process for this topic
                if self.opt_verbose :
                    print("Initializing pipe for topic", topic, "at time", t.to_sec())
                if self.opt_out_file=="":
                    out_file = self.opt_prefix + str(topic).replace("/", "_")+".mp4"
                else:
                    out_file = self.opt_out_file

                if self.opt_verbose :
                    print("Using output file ", out_file, " for topic ", topic, ".")

                if video_fmt == MJPEG_VIDEO :
                    cmd = [VIDEO_CONVERTER_TO_USE, '-v', '1', '-stats', '-r',str(self.fps),'-c','mjpeg','-f','mjpeg','-i','-','-an',out_file]
                    self.p_avconv[topic] = subprocess.Popen(cmd, stdin=subprocess.PIPE)
                    if self.opt_verbose :
                        print("Using command line:")
                        print(cmd)
                elif video_fmt == RAWIMAGE_VIDEO :
                    size = str(msg.width)+"x"+str(msg.height)
                    cmd = [VIDEO_CONVERTER_TO_USE, '-v', '1', '-stats','-r',str(self.fps),'-f','rawvideo','-s',size,'-pix_fmt', pix_fmt,'-i','-','-an',out_file]
                    self.p_avconv[topic] = subprocess.Popen(cmd, stdin=subprocess.PIPE)
                    if self.opt_verbose :
                        print("Using command line:")
                        print(cmd)

                else :
                    print("Script error, unknown value for argument video_fmt in function write_output_video.")
                    exit(1)
            # send data to ffmpeg process pipe
            self.p_avconv[topic].stdin.write(msg.data)
            # next frame time
            self.t_video[topic] += 1.0/self.fps

    def addBag(self, filename):
        if self.opt_display_images:
            from cv_bridge import CvBridge, CvBridgeError
            bridge = CvBridge()
            cv_image = []

        if self.opt_verbose :
            print("Bagfile: {}".format(filename))

        if not self.opt_prefix:
            # create the output in the same folder and name as the bag file minu '.bag'
            self.opt_prefix = bagfile[:-4]

        #Go through the bag file
        bag = rosbag.Bag(filename)
        if self.opt_verbose :
            print("Bag opened.")
        # loop over all topics
        for topic, msg, t in bag.read_messages(connection_filter=self.filter_image_msgs, start_time=self.opt_start, end_time=self.opt_end):
            try:
                if msg.format.find("jpeg")!=-1 :
                    if msg.format.find("8")!=-1 and (msg.format.find("rgb")!=-1 or msg.format.find("bgr")!=-1 or msg.format.find("bgra")!=-1 ):
                        if self.opt_display_images:
                            np_arr = np.fromstring(msg.data, np.uint8)
                            cv_image = cv2.imdecode(np_arr, cv2.CV_LOAD_IMAGE_COLOR)
                        self.write_output_video( msg, topic, t, MJPEG_VIDEO )
                    elif msg.format.find("mono8")!=-1 :
                        if self.opt_display_images:
                            np_arr = np.fromstring(msg.data, np.uint8)
                            cv_image = cv2.imdecode(np_arr, cv2.CV_LOAD_IMAGE_COLOR)
                        self.write_output_video( msg, topic, t, MJPEG_VIDEO )
                    elif msg.format.find("16UC1")!=-1 :
                        if self.opt_display_images:
                            np_arr = np.fromstring(msg.data, np.uint16)
                            cv_image = cv2.imdecode(np_arr, cv2.CV_LOAD_IMAGE_COLOR)
                        self.write_output_video( msg, topic, t, MJPEG_VIDEO )
                    else:
                        print('unsupported jpeg format:', msg.format, '.', topic)

            # has no attribute 'format'
            except AttributeError:
                try:
                        pix_fmt=None
                        if msg.encoding.find("mono8")!=-1 or msg.encoding.find("8UC1")!=-1:
                            pix_fmt = "gray"
                            if self.opt_display_images:
                                cv_image = bridge.imgmsg_to_cv2(msg, "bgr8")

                        elif msg.encoding.find("bgra")!=-1 :
                            pix_fmt = "bgra"
                            if self.opt_display_images:
                                cv_image = bridge.imgmsg_to_cv2(msg, "bgr8")

                        elif msg.encoding.find("bgr8")!=-1 :
                            pix_fmt = "bgr24"
                            if self.opt_display_images:
                                cv_image = bridge.imgmsg_to_cv2(msg, "bgr8")
                        elif msg.encoding.find("bggr8")!=-1 :
                            pix_fmt = "bayer_bggr8"
                            if self.opt_display_images:
                                cv_image = bridge.imgmsg_to_cv2(msg, "bayer_bggr8")
                        elif msg.encoding.find("rggb8")!=-1 :
                            pix_fmt = "bayer_rggb8"
                            if self.opt_display_images:
                                cv_image = bridge.imgmsg_to_cv2(msg, "bayer_rggb8")
                        elif msg.encoding.find("rgb8")!=-1 :
                            pix_fmt = "rgb24"
                            if self.opt_display_images:
                                cv_image = bridge.imgmsg_to_cv2(msg, "bgr8")
                        elif msg.encoding.find("16UC1")!=-1 :
                            pix_fmt = "gray16le"
                        else:
                            print('unsupported encoding:', msg.encoding, topic)
                            #exit(1)
                        if pix_fmt:
                            self.write_output_video( msg, topic, t, RAWIMAGE_VIDEO, pix_fmt )

                except AttributeError:
                    # maybe theora packet
                    # theora not supported
                    if self.opt_verbose :
                        print("Could not handle this format. Maybe thoera packet? theora is not supported.")
                    pass
            if self.opt_display_images:
                cv2.imshow(topic, cv_image)
                key=cv2.waitKey(1)
                if key==1048603:
                    exit(1)
        if self.p_avconv == {}:
            print("No image topics found in bag:", filename)
        bag.close()



if __name__ == '__main__':
    #print()
    #print('rosbag2video, by Maximilian Laiacker 2020 and Abel Gabor 2019')
    #print()

    if len(sys.argv) < 2:
        print('Please specify ros bag file(s)!')
        print_help()
        sys.exit(1)
    else :
        videowriter = RosVideoWriter()
        try:
            opt_files = videowriter.parseArgs(sys.argv[1:])
        except getopt.GetoptError:
            print_help()
            sys.exit(2)


    # loop over all files
    for files in range(0,len(opt_files)):
        #First arg is the bag to look at
        bagfile = opt_files[files]
        videowriter.addBag(bagfile)
    print("finished")
저작자표시 (새창열림)

'Programming > 기타 etc.' 카테고리의 다른 글

conda 사용중 "An HTTP error occurred" 가 발생할 경우  (0) 2022.08.29
[Git] github -> gitlab / repository를 이사하자  (0) 2021.12.06
float 값의 비교 (== 연산자는 위험하다!)  (0) 2021.04.13
google drive web client 사용량 제한  (0) 2021.02.25
pycharm 사용 및 환경설정 팁  (0) 2019.03.18
블로그 이미지

매직블럭

작은 지식들 그리고 기억 한조각

,

float 값의 비교 (== 연산자는 위험하다!)

Programming/기타 etc. 2021. 4. 13. 11:29




일반적으로 값의 같음을 비교할떄 == 비교연산자를 사용한다.

 

실수 값의 비교에서도 아무생각없이 사용하는 경우가 많은데

실수의 같음 비교에 == 를 사용하는것은 매우 위험할 수 있다.

 

이는 float, double 과 같은 실수형 자료는 부동소수점 형태로 구현되어있어 발생하는 문제이다.

 

상식적으로는 0.1 + 0.2 == 0.3 이 수식이 틀릴 리 없는 숫자이지만

프로그램 관점에서는 값이 다를수 있다.

저 소수점 한참 아래의 오차값이 발생하기 때문이다.

 

이러한 문제를 해결하기위한 실수 비교 방법은 두가지가 있다.

 

1. 두 값의 차이를 이용한 방법

단순 비교연산자로 비교하는 방법이 아닌 두 값의 차이가 특정값(입실론으로 표현함) 이하일 경우 같은수로 판단

부동 소수점 표현의 특성상 나타나는 오차는 매우 작은 값을 가지므로 두 값의 차이가 매우 작은 값 이하라면

두 값은 같은 값이라 판단할 수 있다. 

이러한 기준이 되는 입실론의 크기는 사용하는 언어에 따라 각각 정의되어 있다.

단, 값의 대소관계를 모르기 떄문에 절대값을 취한뒤 크기를 비교한다.

 

 

2. decimal 형변환을 통한 비교

실수값을 decimal 로 형변환을 수행하면 고정소수점 방식으로 계산되어 오차를 개선할 수 있다.

이는 사용하는 언어에 따라 다를 수 있다.

 

 

이 외에도 fsum, round 등의 방법을 이용하여 보완할 수는 있지만 이들은 이들 나름의 문제점을 가지고 있어서

사용시 주의해야 한다.

 

 

사람의 기준에서는 오류가 없는 방법이지만

언젠가 크게 뒤통수 맞을 수 있는 위험을 가지고 있으니 기억해 두고 습관화 하는게 좋을것 같다.

저작자표시 (새창열림)

'Programming > 기타 etc.' 카테고리의 다른 글

[Git] github -> gitlab / repository를 이사하자  (0) 2021.12.06
[ROS] Rosbag2Video  (0) 2021.11.30
google drive web client 사용량 제한  (0) 2021.02.25
pycharm 사용 및 환경설정 팁  (0) 2019.03.18
폴더 내의 파일목록을 다뤄보자. 폴더 내 파일 리스트 만들기  (0) 2015.12.17
블로그 이미지

매직블럭

작은 지식들 그리고 기억 한조각

,

google drive web client 사용량 제한

Programming/기타 etc. 2021. 2. 25. 11:08




구글 드라이브의 파일을 다운받기 위해 파이썬 등을 이용하는 경우가 있다.

파일의 크기가 크지않으면 별다른 문제가 안되는것 같지만 대용량 파일을 받는 경우 문제가 발생함.

 

찾다보니 "https://drive.google.com/uc?id=~~~~~" 형태로 사용하는 파일에 직접 접근하는 방식의 경우

시간당 제한량과 하루 제한량이 있어서 접근이 차단 된 상태였다.

(물론 이 상황에서도 웹브라우저를 통해 하나씩 다운로드 하는건 가능하다..)

 

일단 제한량이 있다는 것을 알게됐으니 기록기록

 


Limit per Hour per Day
Download via web client 750 MB 1250 MB
Upload via web client 300 MB 500 MB
저작자표시 (새창열림)

'Programming > 기타 etc.' 카테고리의 다른 글

[Git] github -> gitlab / repository를 이사하자  (0) 2021.12.06
[ROS] Rosbag2Video  (0) 2021.11.30
float 값의 비교 (== 연산자는 위험하다!)  (0) 2021.04.13
pycharm 사용 및 환경설정 팁  (0) 2019.03.18
폴더 내의 파일목록을 다뤄보자. 폴더 내 파일 리스트 만들기  (0) 2015.12.17
블로그 이미지

매직블럭

작은 지식들 그리고 기억 한조각

,

pycharm 사용 및 환경설정 팁

Programming/기타 etc. 2019. 3. 18. 10:21




1. method 단위 구분 선 삽입

환경설정 - Edigor - General - Appearance - Show Method separators 에 체크
활성화 할 경우 각 메소드 단위로 아래에 구분선이 표시된다.


2. 현재 라인 빠르게 복사 - 붙여넣기 

ctrl + D 를 누르면 현재 커서가 위치한 라인의 코드가 아래줄에 한줄 추가로 복사-붙여넣기 된다.


3. 자동완성 기능에 대소문자 구분하지 않기

기본 값으로는 자동완성시 대소문자를 구분하여 목록을 보여준다.
환경설정 - Editors - General - Code Completion - Case sensitive completion 의 값을 수정
none / All / First letter 세가지 옵션이 있다.


4. 파라미터 목록 힌트 띄우기

함수를 사용할때 처음 타이핑 할때는 파라미터 목록이 뜨지만 포커스가 바뀌는 등의 경우에는 목록 힌트가 사라짐
이 경우 다시 목록 힌트를 보고 싶다면
Ctrl + Shift + Space


5. 페이지 좌우 스크롤 하기

코드나 디버깅 정보를 확인 하다 보면 화면 너머로 길게 나온는 경우 쉽게 스크롤 하는 방법
세로 스크롤은 마우스휠로 / 가로 스크롤은 shift + 마우스휠


6. 현재 문서만 남기고 열린 문서 닫기

파일 우클릭 후 Close Others를 선택해도 되지만 Alt + 탭의 x 클릭 으로도 한번에 다른 창을 다 닫을 수 있다.


7. 디버깅 모드에서 콘솔 창 이용하기

코드 우클릭 - Execute Line in Console 을 이용하거나
하단 콘솔 윈도우 하단에 있는 Show python prompt 를 이용


8. 메인 프로그램 파라미터 삽입하기

sys.argv 같이 파라미터를 입력받아야 하는 경우가 있다.
run - Edit Configurations - Configuration - Parameters 에 값 넣어주기



지속적으로 추가 예정.


저작자표시 비영리 (새창열림)

'Programming > 기타 etc.' 카테고리의 다른 글

[Git] github -> gitlab / repository를 이사하자  (0) 2021.12.06
[ROS] Rosbag2Video  (0) 2021.11.30
float 값의 비교 (== 연산자는 위험하다!)  (0) 2021.04.13
google drive web client 사용량 제한  (0) 2021.02.25
폴더 내의 파일목록을 다뤄보자. 폴더 내 파일 리스트 만들기  (0) 2015.12.17
블로그 이미지

매직블럭

작은 지식들 그리고 기억 한조각

,

폴더 내의 파일목록을 다뤄보자. 폴더 내 파일 리스트 만들기

Programming/기타 etc. 2015. 12. 17. 10:37




이제는 윈도우로 인해 대부분이 사용하지 않는 dos 명령어.


그중에 잘 쓰면 편리한 것들이 많이 있다.


오늘은 디렉토리 내 파일 목록과 관련된 dir 명령어를 정리 해 보자.


이 명령어를 이용하면 폴더 내 파일의 리스트를 한번에 출력하는등 은근 깨알같이 도움이 된다.


일반적으로 dir 명령어의 사용법은 아래와 같다


>> dir [path] [flag]


path의 경우 별도로 지정하지 않을 경우 현재 위치를 기준으로 실행하게 된다.


flag에 사용가능한 옵션은 아래와 같다. 


=========== Option ==========================================================

/A : 지정된 특성을 가진 파일을 보여줍니다.

  • D 디렉터리
  • R 읽기 전용 파일
  • H 숨김 파일 
  • A 기록 파일
  • S 시스템 파일 

/B : 최소 형식을 사용합니다 (머리말 정보나 요약 없음).
/C : 파일 크기에 1000단위로 분리 기호를 보여줍니다. 이것은 기본값
입니다. 분리 기호를 표시하지 않으려면 /-C를 사용하십시오.
/D : /W와 같으나 세로로 배열하여 보여줍니다.
/L : 소문자를 사용합니다.
/N : 파일 이름이 제일 오른쪽에 오도록 새로운 긴 목록 형식을 사용합니다.
/O : 파일을 정렬된 순서로 보여줍니다.

  • N 이름순(문자 순서)
  • S 크기순(작은 것 먼저)
  • E 확장명순(문자 순서)
  • D 날짜/시간순(가장 이전 것 먼저)
  • G 그룹 디렉터리 먼저 

/P : 정보가 한 화면에 꽉 차면 잠깐 멈춥니다.
/Q : 파일 소유자를 보여 줍니다.
/S : 지정한 디렉터리와 하위 디렉터리를 포함하여 보여줍니다.
/T : 정렬에 사용할 시간 필드를 지정합니다.

  • C 작성한 시간
  • A 마지막 액세스한 시간
  • W 마지막 기록한 시간

/W : 이름만 가로로 배열하여 보여줍니다.
/X : 8.3 파일 이름이 아닌 파일에 대한 짧은 이름을 보여줍니다.
    이 형식은 긴 이름 앞에 짧은 이름이 추가된 것으로 /N 형식과
    같습니다. 짧은 이름이 없으면 공백을 보여줍니다.
/4 : 4자리수 연도를 표시합니다.


출처 : http://blog.naver.com/iwishsinji/140007608531

=========== Option ==========================================================


/A, /O, /T와 같이 옵션을 갖는 경우에는 /A:D 와 같이 콜론을 이용하여 옵션을 표시 해 준다.

[출처] dir 도움말|작성자 그냉이



이렇게만 사용하면 CMD 창에 리스트가 출력된다.


이제 이놈들을 우리가 원하는 파일로 출력을 하려면 


>Filename.txt 또는 >Filename.xls 를 뒤에 붙여주면 지정한 Filename으로 파일이 만들어 진다.


즉 파일 리스트를 만들고 싶다 하는 경우에는 아래와 같이 쓸 수 있다는 얘기


>> dir /b /d >list.txt

저작자표시 비영리 (새창열림)

'Programming > 기타 etc.' 카테고리의 다른 글

[Git] github -> gitlab / repository를 이사하자  (0) 2021.12.06
[ROS] Rosbag2Video  (0) 2021.11.30
float 값의 비교 (== 연산자는 위험하다!)  (0) 2021.04.13
google drive web client 사용량 제한  (0) 2021.02.25
pycharm 사용 및 환경설정 팁  (0) 2019.03.18
블로그 이미지

매직블럭

작은 지식들 그리고 기억 한조각

,
  • «
  • 1
  • »

카테고리

  • 살다보니.. (449)
    • 주절거림 (3)
    • 취미생활 (36)
      • 지식과 지혜 (3)
      • 풍경이 되어 (4)
      • Memories (17)
      • 엥겔지수를 높여라 (2)
    • mathematics (6)
      • Matrix Computation (2)
      • RandomProcesses (3)
    • English.. (8)
    • Programming (147)
      • C, C++, MFC (51)
      • C# (1)
      • OpenCV (17)
      • Python (58)
      • Git, Docker (3)
      • Matlab (4)
      • Windows (3)
      • Kinect V2 (2)
      • 기타 etc. (8)
    • 전공관련 (80)
      • Algorithm (6)
      • Deep Learning (54)
      • 실습 프로그램 (4)
      • 주워들은 용어정리 (8)
      • 기타 etc. (8)
    • Computer (118)
      • Utility (21)
      • Windows (31)
      • Mac (4)
      • Ubuntu, Linux (58)
      • NAS (2)
      • Embedded, Mobile (2)
    • IT, Device (41)
      • 제품 사용기, 개봉기 (14)
      • 스마트 체험단 신청 (27)
    • Wish List (3)
    • TISTORY TIP (5)
    • 미분류. 수정중 (1)

태그목록

  • 딥러닝
  • matlab
  • ReadString
  • portugal
  • CStdioFile
  • review
  • 오봉자싸롱
  • LIBSVM
  • 매트랩 함수
  • 칼로리 대폭발
  • 후쿠오카
  • 에누리닷컴
  • 일본
  • Deep Learning
  • 스마트체험단
  • SVM
  • Computer Tip
  • 포르투갈
  • utility
  • ColorMeRad
  • 크롬
  • Convolutional Neural Networks
  • 매트랩
  • 큐슈
  • DSLR
  • matlab function
  • function
  • 갤럭시노트3
  • random variable
  • DeepLearning

달력

«   2025/06   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
06-19 08:33

LATEST FROM OUR BLOG

RSS 구독하기

BLOG VISITORS

  • Total :
  • Today :
  • Yesterday :

Copyright © 2015 Socialdev. All Rights Reserved.

티스토리툴바